Font with attributes in swift 4 and swift 5
Solution:
let attrs = [NSParagraphStyleAttributeName: style,NSForegroundColorAttributeName:UIColor.white,NSFontAttributeName:UIFont(name: "Trebuchet MS", size: 20)]
swift 5:
let attrs = [NSAttributedString.Key.paragraphStyle: style,NSAttributedString.Key.foregroundColor:UIColor.white,NSAttributedString.Key.font:UIFont(name: "Trebuchet MS", size: 20)]
Comments
Post a Comment