Navigating an iOS app [duplicate]

This question is an exact duplicate of:

I have an iOS application that uses a UINavigationController. It gets initialised with a custom LoggedInViewController or LoggedOutViewController, depending on whether you are logged in or not.

The hierarchy looks like this when you start the app when logged out:

  1. LoggedOutViewController
  2. GetStartedViewController
  3. LogInViewcontroller
  4. LoggedInViewController
  5. 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?


Source: ios

Leave a Reply