This question is an exact duplicate of:
I have an iOS application that uses a
UINavigationController. It gets initialised with a custom
LoggedOutViewController, depending on whether you are logged in or not.
The hierarchy looks like this when you start the app when logged out:
- Etc. (normal app navigation)
Now: Whenever i log in, to my understanding, steps 1, 2 and 3 still exist in the background when i reach step 4. Which is not necessary because i won’t be returning to them any time soon. I need some way of “restarting” the app/clearing the navigation stack. How would i tackle this situation? How do other apps do this?