This question already has an answer here:
Is it possible to pop the navigation controller twice? I have this navigation structure:
View One ----> View Two -----> View Three
What I'd like to accomplish is that by the tap of a row on View Three, go back directly to View One. I've done it from Three to Two via protocol-delegate, but setting the delegate in view One doesn't work and setting two consecutive delegate-protocol both poping the navigation controller, gives me error: nested navigation controller activity (or something similar).
Any help would be appreciated. Thanks in advance!
Use the following code. You can use any number instead of
-3
to pop to a different level.Obj-C:
Swift 3.0*:
There is a few pop options
self.navigationController.viewControllers
and then work with the array to get the specific viewController you want to pop toYou can try this
Hope it Helps!!
'self' seems to be released after first pop