I have an app and I want to have separate windows. What's the best way to load them all on startup? I think I want to have the main window load the others. Here's what I got now, doesn't work..
I subclassed the main window controller, and am trying to load another storyboards window. (I can keep in it in the main storyboard if needed).
class MainWindow: NSWindowController {
override init() {
super.init()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
let sb = NSStoryboard(name: "SecondStoryboard", bundle: nil)
let win = sb?.instantiateControllerWithIdentifier("WindowTwo") as NSWindowController
win.showWindow(nil)
}
}
In the end, I need to be able to pass data between the controllers.