The following seems like a typical use case: You start the app with a LoginViewController that displays the login screen. Once the user has successfully logged in, you want to show the main view for your app (let’s call it MainViewController).
You don’t want to put the LoginViewController into a UINavigationController and subsequently push MainViewController onto it because there’s no reason to keep the LoginViewController present at the bottom of the stack since it will never be shown again. Also, in subsequent launches of the app, you’ll determine that you’ve already got a login token of some kind and will never end up showing the LoginViewController at all so there’d be inconsistency from launch to launch of the navigation controller’s stack.
You also don’t want to modally present MainViewController from LoginViewController for the same reason (if it’s modal it would keep the LoginViewController loaded behind).
You also don’t want to set the window’s rootViewController to MainViewController (where it was previously set to LoginViewController) because that won’t allow you have a transition.
I’d like some feedback on whether my logic above is flawed and in fact one of these scenarios is the right one? Or if not, what are others doing for this scenario?
Why not make the MainViewController your app’s root view controller, and present the LoginViewController modally upon launch if you don’t have a login token?