When user start the app, I'll check the auth status, and show different ViewControler
Logged in -> Main ViewController -> Will pushViewController or presentViewController according to user action
Need Log in -> SignIn ViewController -> Main ViewController -> Will pushViewController or presentViewController according to user action
My question is how to back to SignIn ViewController when user want to sign out.
Method One:
Current ViewController -> presentViewController/pushViewController SignIn ViewController
Issue: Previous ViewControllers are still in memory
Method Two:
Current ViewController -> popToRootViewControllerAnimated -> presentViewController/pushViewController SignIn ViewController
Issue: If the user logged in before, the RootViewController will be Main ViewController, we can't release the Main ViewController with the method.
Method Three:
[[[[UIApplication sharedApplication] delegate] window] setRootViewController:signinNavigationController];
Issue: No animate, and looks previous ViewController are still in memory.