在swift 2中我使用的是CNLabeledValue.localizedStringForLabel(phoneNumber.label)
,并且正常工作。如何在swift3中获取CNLabeledValue的本地化字符串
在SWIFT 3我想这条线CNLabeledValue.localizedString(forLabel: phoneNumber.label!)
但得到generic parameter 'ValueType' could not be inferred
错误
如何获得在swift3 localizedstring为CNLabeledValue?
你能否提供关于为什么有必要指定'NSString'而不是'String'任何其他的解释吗? –
@MurraySagal,'CNLabeledValue'的通用参数被声明为''。因此,在这种情况下,您可以选择符合'NSCopying'和'NSSecureCoding'的任何类型。 'NSString'和'String'不一样。 –
OOPer
谢谢你解决这个问题。为什么它不是XCode中Swift 3 Converter的一部分让我感到... –