I have segued to a view controller which is embedded in a navigation controller for title purposes. I want to remove the button which allows me to go back to the last view controller without having to unembed the navigation controller. How might I do this?
Asked
Active
Viewed 577 times
0
-
This should do it http://stackoverflow.com/questions/1453519/how-to-hide-the-back-button-in-uinavigationcontroller – Peter Combee Mar 19 '17 at 19:47
-
you want to completely remove it? or just do not show the title, but only the `<`, and with the functionality of going back? – Laura Calinoiu Mar 19 '17 at 19:48
1 Answers
0
You can do this by accessing the navigationItem of the UINavigationController, and using the setHidesBackButton(_:animated:)
method.
self.navigationController?.navigationItem.setHidesBackButton(true, animated: false)
You can read about the method in Apple's documentation here: https://developer.apple.com/reference/uikit/uinavigationitem/1624934-sethidesbackbutton

Frederik
- 384
- 3
- 7