1

I have a multi-screen app, with RootPageViewController as starting ViewController. When the user logs out of his/her account, I want to dismiss all ViewControllers and present the WelcomeViewController. Down below is what I do;

if let appDelegate = UIApplication.shared.delegate as? AppDelegate {
    appDelegate.window?.rootViewController?.dismiss(animated: true, completion: nil)
            
    if appDelegate.window?.rootViewController is RootPageViewController {
        appDelegate.window?.rootViewController = nil
        appDelegate.window?.rootViewController = self.storyboard?.instantiateViewController(withIdentifier: "WelcomeViewController") as! WelcomeViewController
    }
}

Everything works, except the fact that RootPageViewController's deinit is never called... What could be happening here? Does RootPageViewController never get released?

Sotiris Kaniras
  • 520
  • 1
  • 12
  • 30

0 Answers0