I tried this code:
navigationController?.navigationItem.backBarButtonItem?.title = ""
but it does not work and did not change anything. How can I set backButton text to empty?
I tried this code:
navigationController?.navigationItem.backBarButtonItem?.title = ""
but it does not work and did not change anything. How can I set backButton text to empty?
I tried this code for back button title. and it's work correctly
let barButton = UIBarButtonItem()
barButton.title = ""
self.navigationController?.navigationBar.topItem?.backBarButtonItem = barButton
self.navigationController!.navigationBar.topItem!.title = ""
You should use:
navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .Plain, target: nil, action: nil)
for see just < instead of < viewController
You have to change the previous controller's title, try doing so before the segue in the viewDidDisappear
self.navigationItem.leftBarButtonItem=nil;
or
self.navigationItem.backBarButtonItem=nil;
To remove the backButtonItem
's title, place this line of code in the viewDidLoad:
of the View Controller
that the backButtonItem
is in:
navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .Plain,
target: nil, action: nil)