Using Swift (with import Cocoa) in xCode, I am trying to set the default font size of a TextView window. I see that I can set the default font name and size this way:
class ViewController: NSViewController {
@IBOutlet var textView: NSTextView!
...
override func viewDidAppear() {
let document = self.view.window?.windowController?.document as! Document
textView.textStorage?.setAttributedString(document.text)
textView.font = NSFont(name: "Helvetica", size: 18);
}
And I think I see that I need to use nsUserFontOfSize to specify only the point size, but I can't figure out the syntax after much searching. Exactly what should the syntax be in place of the string "NSFont(name: "Helvetica", size: 18);"?