title: How to dismiss previous Viewcontroller after presenting new Viewcontroller using Swift?
body: <p>My Scenario, In my project I am maintaining three <code>ViewController</code> <code>(Main, VC1 and VC2)</code>. In main <code>ViewController</code> I am maintaining <code>UIButton</code>, This button click to <code>VC1</code> presenting model view controller.  Again, <code>VC1</code> I am maintain <code>UIButton</code> with action click to present model to <code>VC2</code>. After <code>VC2</code> presenting I need to dismiss VC1.</p>
  
  <pre><code>//  presenting ViewController
  var presentingViewController: UIViewController! = self.presentingViewController
  
  self.dismissViewControllerAnimated(false) {
        // go back to MainMenuView as the eyes of the user
        presentingViewController.dismissViewControllerAnimated(false, completion: nil)
  }
  </code></pre>