title: Removing a view controller from memory when instantiating a new view controller
body: <p>In my app, I am instantiating new view controllers instead of using segues because it looks better in animations as a result, my views keep running in the background. This causes large memory leaks.</p>
  
  <p>My code to go back to the main screen is:</p>
  
  <pre><code>let mainStoryboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle())
          let vc  : UIViewController = mainStoryboard.instantiateViewControllerWithIdentifier("MainScreen") as UIViewController
          self.presentViewController(vc, animated: false, completion: nil)
  </code></pre>
  
  <p>This view controller is still active in the background and therefore shouldn't be instantiated again. How do I do this.</p>
  
  <p>When I close my view controller using the above code, it also does not unload it, it keeps running in the background. How do I make it unload as soon as the screen disappears.</p>
  
  <p>I have tried doing </p>
  
  <pre><code>override func viewDidDisappear(animated: Bool) {
      super.viewDidDisappear(animated)
      view.removeFromSuperview()
      view = nil
  }
  </code></pre>
  
  <p>However this does not work properly. How do I properly destroy a view controller from memory when exiting a view controller in this manner.</p>