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

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift