A string is just plane text. An attributed string can have attributes like bold, colors and clickable links etc.
NSAttributedString
NSMutableAttributedString
Strings in NSScrollView and NSTextView
|
1 2 3 4 5 6 7 8 9 10 11 12 |
// the following will convert a NSScrollView to a NSTextView // textScroll is the name of the NSScrollView @IBOutlet let textView1: NSTextView = textScroll.documentView! as! NSTextView // put string text into a textScroll let string1 = "Hello world 1" textScroll.documentView!.insertText("Hello world") textScroll.documentView!.insertText("Hello world \(string1)") // textView1 is the name of the NSTextView @IBOutlet // put string text into a textView textView1.string = "Hello world" |
Convert dates and time to a string