How do I call a function in my ViewController from my NSWindow?
1 answer
From my NSWindow, I was able to access the NSViewController like this:
let controller = self.windowController()?.contentViewController as! ViewController;
where ViewController
is the name of my ViewController subclass NSViewController.
It's still not clear to me why I can't just create an Outlet using a storyboard.
+4
source to share