I have created a navigation controller. In the second view (which is pushed), I have some webservice call and placing a overlay view and setting
self.view.userInteractionEnabled = NO ;
Once web service call is complete, then I am reverting to
self.view.userInteractionEnabled = YES ;
When I do this, every other buttons except the buttons on the navigation bar are disabled. How to disable those two navigation bar button items ? (a button similar to back button, which pops to first view controller and another button which gives info about help).
I have tried using self.navigationItem.backBarButtonItem.enabled = NO
. But still I am able to tap on the button and can navigate to first screen. How can I disable these two buttons ?
For version iOS 10.3, swift 3:
Swift 5 & iOS 13 :
To remove all left buttons or just a specified one just remove from
leftBarButtonItems
Array.tested on Mvvmcross Xamarin.iOS only
If you want to disable a navigation bar button item OR you want to disable hole UINavigationBar i.e. all item present on navigation bar, use below lines of code;
Enjoy...!
I solved this by just adding a property to my viewcontroller:
I then connected it to the button on the storyboard. You can then at will set its properties like:
You can do the following if you are running on
Swift
This snippet will disable the button.