popping to root view in navigation controller
Asked Answered
C

1

11

I have one navigation controller with three views. I push the three view controllers onto the navigation controller's stack and want to pop all the pushed view controllers at once by the click on a button. I would like to be able to do that from any pushed view controller...

Please can you help me and give me pointers on how I could do that?

Convolution answered 12/3, 2011 at 10:11 Comment(0)
E
52
[self.navigationController popToRootViewControllerAnimated:YES];
Equation answered 12/3, 2011 at 10:13 Comment(2)
thanks, is there a way for the rootviewcontroller to know that this action happened, so it can give a feed back like "Done bro!" ?Dunbar
navigationController?.popToRootViewControllerAnimated(true) for SwiftLovemaking

© 2022 - 2024 — McMap. All rights reserved.