Swift - How to hide back button in navigation item?
In case you're using a UITabBarController
:
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
self.tabBarController?.navigationItem.hidesBackButton = true
}
According to the documentation for UINavigationItem
:
self.navigationItem.setHidesBackButton(true, animated: true)