0

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?

porgo
  • 1,572
  • 2
  • 12
  • 23
tore
  • 379
  • 3
  • 16

0 Answers0