I have 3 view controllers: VC1,VC2, VC3. The navigation is made pushing viewcontrollers (forward) like this: VC1 -> VC2 -> VC3. Now once I an in VC3, pressing a button I want to go back to VC1 (not VC2). If I use a pop I'd go into VC2, but how would I go directly from VC3 into VC1? (Like poping twice...)
Asked
Active
Viewed 32 times
1 Answers
1
Sounds like what you want is an popToViewController:
.
Take a look a this solution: Can i pop to Specific ViewController?

Community
- 1
- 1

Simon Germain
- 6,834
- 1
- 27
- 42
-
Or use `popToRootViewController:`. – rmaddy Nov 25 '16 at 20:29
-
Right, but you don't necessarily want to go to the root one. In the OP's case, yes, but it's also a good alternative. – Simon Germain Nov 28 '16 at 17:22