title: How to change content view of Window?
body: <p>I am developing an mac osx application which have initial window and viewcontroller launched from main storyboard. I want to replace the content view loaded by storyboard with my view. 
  I am doing this -</p>
  
  <pre><code>func replaceContentView() {
    parentViewController =  MainViewController(nibName: "MainContainerView", bundle: nil)!
    let fullScreenFrame = NSScreen.mainScreen()?.visibleFrame
    self.initialWindow.setFrame(fullScreenFrame!, display: false, animate: false)
    self.initialWindow.contentView = parentViewController! . view
  }
  </code></pre>
  
  <p>Problem with this approach is that the default viewcontroller is never getting deallocated. <strong>deinit()</strong> of default viewController is not called at all.
  This is causing memory leak. So how to completely  remove default content view and associated viewcontroller?</p>