I am using a UINavigationController to slide from a UITableViewController to another view. In that second view I have created a custom "Back" button which is attached to an action.
What code do I use to return to dismiss the current view and slide back to my first view? I need something that is the equivalent to [super dismissModalViewControllerAnimated:true]; but obviously this is not a modal view.
Thanks.
Look at one of the following three methods on your navigation controller:
popViewControllerAnimated:
popToRootViewControllerAnimated:
popToViewController:animated:
Depending on how you want to handle it of course. Generally one just uses the first method to go back to the last view (the one that pushed your current view onto the navigation stack).
Use popToRootViewControllerAnimated method in UINavigationController:
[self.navigationController popToRootViewControllerAnimated:animated];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With