I have a UITabBarController
(my app's home page) using its navigationController
to show a 2nd UIViewController
. I want to hide the back button completely from the 2nd viewController.
In my 2nd UIViewController
's viewDidLoad()
I'm trying to hide the back button in many ways (and I've tried all reasonable subsets of these):
navigationItem.hidesBackButton = true
navigationItem.setLeftBarButtonItems(nil, animated: true)
navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .Plain, target: nil, action: nil)
navigationItem.setHidesBackButton(true, animated: false)
let backButton = UIBarButtonItem(title: "", style: UIBarButtonItemStyle.Plain, target: navigationController, action: nil)
navigationItem.leftBarButtonItem = backButton
and the text (the title of the tab bar controller) persists:
I don't want to jump to the conclusion that this is a bug, but might this be a bug in iOS?
I've tried all the answers found here: iOS 8: UINavigationController hide back button, but none of them have given me success.