let linkTextAttributes = [
NSAttributedStringKey.underlineStyle: NSNumber(value: NSUnderlineStyle.styleSingle.rawValue as Int),
NSAttributedStringKey.foregroundColor: FAColor.blackColor()
]
self.lblPinDidNotMatchDescription.linkTextAttributes = linkTextAttributes
在Swift 4迁移时出错
"无法转换类型' [String:AnyObject]的值?'预期参数类型' [NSAttributedStringKey:Any]?'"。
任何帮助?
答案 0 :(得分:0)
更改为NSUnderlineStyle.styleSingle.rawValue
实施例
let linkTextAttributes: [NSAttributedStringKey: Any] = [
NSAttributedStringKey.underlineStyle: NSUnderlineStyle.styleSingle.rawValue,
NSAttributedStringKey.foregroundColor: UIColor.black
]