I tried to identify what the "Back" text is from by the following:
public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.navigationBar.setTransparent(style: .default)
print(self.navigationItem.backButtonTitle)
print(self.navigationItem.backBarButtonItem?.title)
print(self.navigationItem.title)
print(self.navigationItem.titleView?.largeContentTitle)
}
However I got all nil outputs, which means these titles are not there:
nil
nil
nil
nil
I also tried this:
self.navigationItem.setHidesBackButton(true, animated: false)
It works but it hides the whole thing, including the back arrow "<" and the text "Back". I wanted to keep the arrow but only remove the text.
Where can I find this title or text that says "Back" and set it to empty string?
3
Answers
one way is shown in attached Image.
Second one is follow:
This will work for you
You can use custom left bar button item, in viewDidLoad:
to go back the button call handleBack func: