Question

The scenario I have is this. I have 5 view controllers: Root, A, B, C, D

I am currently on screen B and my navigation stack contains Root, A, B.

Once the user performs a certain action on B I want to navigate to D without any other screens showing, and I want the back button to point to C. The full navigation stack should look like: Root => C => D.

So effectively, I want to pop to my root view controller, then push C, and push D. However, I don't want Root and C to appear.

Is this possible?

Was it helpful?

Solution

Use the setViewControllers:animated: method in B to push an instance of C and D at the same time. It will look like a simple push to the user but in reality you are effectively popping and pushing multiple views.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top