Reputation: 689
I have a large string and I want parts of it to be in italics or bold. I have successfully used NSMutableAttributedString
to change certain properties. See below:
let attributedString = NSMutableAttributedString.init(string: "Testing Bold")
attributedString.addAttribute(.foregroundColor, value: UIColor.blue, range: NSRange.init(location: 0, length: 5))
testlabel.attributedText = attributedString
But I can't find anything called italics or bold in the dropdown menu of attribute choices. Am I missing something?
Upvotes: 0
Views: 27