Im having login pages where im trying to push each ViewController and after successful verification im trying to set root view using code
UIApplication.shared.delegate?.window??.rootViewController = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "Some") as! Some
Above code is not working and for logout also im setting the root view controller, but those are not working. Please help me out. Thanks in advance.
Login 1st page(navigationController.pushVc)
--> Success Verification (setting root view controller)
--> Logout(setting root view controller)
.
I have given identifiers to both tabbar controller and navigation controller. Tried in many ways but could not find solution
Tried this link also https://fluffy.es/how-to-transition-from-login-screen-to-tab-bar-controller/
Above link is the same which im trying.But can't do in my project.
I am copying my method here to switch rootViewController after login and logout. I have written this method in AppDelegate:
Calling this method from my viewController:
To access 'self.appDelegate I have added this extension in my viewController
}