Skip to content

Instantly share code, notes, and snippets.

@js51
Created July 15, 2019 01:43
Show Gist options
  • Select an option

  • Save js51/57fc5c2c3d13b2629bd3baf12352176e to your computer and use it in GitHub Desktop.

Select an option

Save js51/57fc5c2c3d13b2629bd3baf12352176e to your computer and use it in GitHub Desktop.
macOS init Window Controller from Storyboard
lazy var myWindowController: MyWindowController = {
let storyboard = NSStoryboard.init(name: "MyStoryboard", bundle: nil)
let myWindowController = storyboard.instantiateController(withIdentifier: "MyWindowControllerID") as! NSWindowController
return myWindowController as! MyWindowController
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment