After my rootViewController, there is a workflow that would go like this
viewController1 -> push viewController2 -> push viewController3 -> ***** viewController2
I would like to popToViewController3. However, I need to go to viewController1 first because viewController1 basically determines which instance of viewController2 to push. So I
// pseudo code
[popToViewController:vc1 animated:NO];
[self.navigationController pushViewController2 animated:YES];
I basically pop before pushing so I don’t end up getting vc2, vc3, vc2, vc3, vc2 etc. But in doing this, since it animates the push of the last viewController, it gives the user the impression that a new viewController was pushed onto the stack, vs popping to the previous viewController. Is there a way to get around this ? If I animate the pop and not the last push, I do not get the correct viewController I want on top by the looks of it. Thanks.
You can retrieve (
viewControllers), modify, and “reinstall” (setViewControllers) the list of view controllers managed by the navigation controller, and the “reinstall” can (in theory) be animated. (However, I had some problems with animation in practice, though I don’t recall the details.)