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

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

store cgpoint in userdefaults iOS swift