Just started to learn Swift and created a little macOS app in which I want to use a NSScrollView to display an attributed String. I’ve tried:
@I
For NSScrollView:
@IBOutlet weak var textScroll: NSScrollView!
Check this out:
let text = textScroll.documentView!.textStorage!!
let attr = NSAttributedString(string: "Hello World")
text.appendAttributedString(attr)
This is very much in spirit of @mrtn.lxo solution, only done for NSScrollView and is using NSAttributedString.