title: Delete unused ViewController from memory
body: <p>I have 3 ViewController.
  The first ViewController is checking if the user is logged in. 
  If yes performSegue to the mainVC and if no performSegue to loginVC.</p>
  
  <p>When I am in loginVC, I log in and performSegue to mainVC.</p>
  
  <p>What I want now is, I want to have all ViewControllers which are unused being "deleted", to save memory.
  How is that going to work? </p>
  
  <p>I found here in StackOverflow this piece of code:</p>
  
  <pre><code>class ManualSegue: UIStoryboardSegue {
  
    override func perform() {
      sourceViewController.presentViewController(destinationViewController, animated: true) {
        self.sourceViewController.navigationController?.popToRootViewControllerAnimated(false)
        UIApplication.sharedApplication().delegate?.window??.rootViewController = self.destinationViewController
      }
    }
  }
  </code></pre>
  
  <p>Is that going to do what I want? It seems like yes because this method is popping the ViewController.</p>
  
  <p>I am using "Show Detail" - segues only, except when using this method I created a custom Segue Segue.</p>