in the Storyboard (Xcode 6, iOS 8 and swift) i have embedded a TableViewController in a Navigation Controller.
From the object library, i have drag & drop a Bar Button Item as the back button and it show an icon image: when i click that button i show a setting view.
How can i hide that button? In the viewDidLoad() i've tried:
self.navigationItem.hidesBackButton = true;
The code is executed (i've tried with the debugger) but the button is always visible.
You can do: [self. navigationItem setHidesBackButton:YES]; In your second view controller (the one you want to hide the button in).
Go to your Navbar settings and find the navigation item you want to hide for a particular page. Click to edit and assign it a classname. You could assign it something like "hide-navigation-item."
Use navigationBarBackButtonHidden(_:) to hide the back button for this view.
You have to try this:
self.navigationItem.setHidesBackButton(true, animated: false)
hope it helps you.
SWIFT 3
self.navigationItem.setRightBarButton(nil, animated: true)
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