I'm trying to allow the user to select a font of his/her choice using the NSFontManager. I could show the font picker using the following code
@IBAction func fontchangeclicked(_ sender: Any) {
NSFontManager.shared.orderFrontFontPanel(nil)
}
But the NSViewController is unable to recognise this overridden function.
override func changefont(_ sender: Any?) {
guard let fontManager = sender as? NSFontManager else {
return
}
let newFont = fontManager.convert(self.globalfont)
self.globalfont = newFont
}