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?
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: { () -> Void in
presentingVC!.present(destinationController, animated: true, completion: nil)
})
presentingVC!.present(destinationController, animated: true, completion: nil); self.dismiss(animated: false, completion:nil)
– Jenisejenkel