1
votes

I have 3 view controllers, vc1, vc2, vc3.

vc1 presents vc2 and vc3.

In vc1 I have the delegate method to dismiss vc2 and in the completion block present vc3.

It works fine. But in between the switch of views, vc1 will show. so vc2 dismiss, vc1 show, vc3 show up.

Is there any way not to show vc1 in the process? I tried to dismiss animation in both dismiss and present.

Thanks!

2
Show some effort by including a minimal but complete and verifiable code.AlessioX
here some people tried to help me with a similar issue, no luck though, maybe you can use the insights there stackoverflow.com/q/31058371/2683201Hugo Alonso

2 Answers

1
votes

One idea might be to just present vc3 on top of vc2. Once you're ready to go back to vc1, just call [self.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil]; and you'll pop both vc2 and vc3 without seeing vc2.

0
votes

One technique is to use UINavigationController's setViewControllers:animated method. Grab the viewControllers array from the nav controller, remove the last item (VC2), append VC3, then pass the array in to setViewControllers. This is essentially a pop-then-push, and it should animate the way you want.