title: dismiss current view controller AFTER presenting new view controller - swift
body: <p>I'm trying to dismiss a VC and present a new VC. but I don't want old VC to exist anymore. I use the code below to dismiss current VC and present new one. but this way, there's a time interval between dismiss and present. I don't want the user to notice this. so, I want to present new VC first and then dismiss previous one. Is there any way to do this?</p>
  
  <pre><code>let storyboard = UIStoryboard(name: "Main", bundle: nil)
  let destinationController = self.storyboard?.instantiateViewController(withIdentifier: "login") as! Login
  let presentingVC = self.presentingViewController
  self.dismiss(animated: false, completion: { () -&gt; Void   in
      presentingVC!.present(destinationController, animated: true, completion: nil)
  })
  </code></pre>