title: Open New Window in Swift
body: <p>I am trying to open a new window in my Swift application but I cannot get it to open.</p>
  
  <pre><code>class AppDelegate: NSObject, NSApplicationDelegate 
  {
      func applicationDidFinishLaunching(aNotification: NSNotification)
      {
          openMyWindow()
      }
  
      func openMyWindow()
      {
          if let storyboard = NSStoryboard(name: "Main",bundle: nil)
          {
              if let vc = storyboard.instantiateControllerWithIdentifier("MyList") as? MyListViewController
              {
                  var myWindow = NSWindow(contentViewController: vc)
                  myWindow.makeKeyAndOrderFront(self)
                  let controller = NSWindowController(window: myWindow)
  
                  controller.showWindow(self)
  
              }
          }
      }
  }
  </code></pre>
  
  <p>I have set the Storyboard ID in IB.</p>
  
  <p>I have traced the code and it does get into the window opening code but it doesn't do anything.</p>
  
  <p>BTW I do have a default storyboard entry point set and that default window opens OK but I need to have a second window open and that is what is not working.</p>