Once I launch my application, the BaseVC inits. In BaseVC, I will verify whether user has logged in. If true, my app will jump to main tabbar controller by using:
UIApplication.sharedApplication().windows.last?.rootViewController = tabbarController
If not, my app will jump to login nav controller by using:
UIApplication.sharedApplication().windows.last?.rootViewController = navi
The code above runs correctly as I wanted. But in the Login Nav Controller, after the user inputted the correct username and password, I want the app to jump to the main tabbar controller by using the same code as above:
UIApplication.sharedApplication().windows.last?.rootViewController = mainController
But always, I will get crush with error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[Myapp.MyappMainTabbarVC inhibitRotationAnimation]:
unrecognized selector sent to instance 0x7ff15b205ec0'
Why?