I want to pop to the third view on the navigation stack back to the first view.
I know how to pop one view at once:
[self.navigationController popViewControllerAnimated:YES];
But how do I do two at once?
Thanks...
I want to pop to the third view on the navigation stack back to the first view.
I know how to pop one view at once:
[self.navigationController popViewControllerAnimated:YES];
But how do I do two at once?
Thanks...
You can try this to Jump between the navigation controller stack as well
objectAtIndex:1 --> you can pass whichever index you want to pop to
Swift 2 - xCode 7.3
This could be a very useful extension to pop UIViewControllers:
If you just want to pop 2 at once because your rootViewController is (way) 'deeper' then 2 you could consider adding a category to UIviewController for example:
UINavigationController+popTwice.h
UINavigationController+popTwice.m
Import the category
#import "UINavigationController+popTwice.h"
somewhere in your implementation and use this line of code to pop 2 controllers at once:isn't that great? :)
You can also try this one :-