let s = NSAttributedString(string: "Percentage", attributes: [NSFontAttributeName : UIFont(name : "Avenir Next Condensed", size : 20), NSUnderlineStyleAttributeName : NSUnderlineStyle.byWord])
textView.attributedText = s
I get the following error for the above code: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_SwiftValue _isDefaultFace]: unrecognized selector sent to instance 0x608000046930'
If I change the NSFontAttributeName to UIFont.boldSystemFont(ofSize: 20), I can see bold text. Also on adding NSUnderlineStyleAttributeName, I don't see any text at all. How can I fix this?
let font = UIFont(name : "Avenir Next Condensed", size : 20)returns nil? Try withAvenirNextCondensed-Regularinstead for the name (you have to use the PostScript name)