Hide back button in navigation bar with hidesBackButton in Swift
You can use the code below to hide back button on UINavigationBar
.
Swift 3;
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationItem.hidesBackButton = true
}
To hide the back button with the latest Swift:
self.navigationItem.setHidesBackButton(true, animated: false)
Try adding this:
let backButton = UIBarButtonItem(title: "", style: .Plain, target: navigationController, action: nil)
navigationItem.leftBarButtonItem = backButton