Swift 3
let drawAttrsString = NSMutableAttributedString()
let attrs: [String : Any] = [
NSForegroundColorAttributeName : configuration.theme.EMAColor(day: day),
NSFontAttributeName : configuration.main.assistTextFont
]
drawAttrsString.append(NSAttributedString(string: “xxx”, attributes: attrs))
Swift 4变化为
let attrs: [NSAttributedString.Key : Any] = [
NSAttributedString.Key.foregroundColor : configuration.theme.EMAColor(day: day),
NSAttributedString.Key.font : configuration.main.assistTextFont
]
Swift 3
NSParagraphStyleAttributeName
Swift 4变化为
NSAttributedString.Key.paragraphStyle
网友评论