Tutorial :How to disable UINavigationController?



Question:

I have a navigation controller-based app in which I would like to temporarily disable the navigation controller (top left button) at a certain point in the app so that the user can't get out of the view while I'm uploading a file. Is there a way to disable the "back" button so that users can't get out of the view?


Solution:1

You could hide the navigation bar entirely with

- (void)setNavigationBarHidden:animated:  

in the appropriate views.

I don't know of an Apple-approved way to disable or otherwise interact with the back button.


Solution:2

In the view controller pushing into the view where you want to hide the back button (NOT in the view controller where you want the back button hidden), do:

self.navigationItem.hidesBackButton = YES;  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »