I want to remove the text from the back button, but I want to keep the icon. I have tried
let backButton = UIBarButtonItem(title: \"\", style: UIBarButtonIt
The text of the back button depends on the title of the master view.
The trick is to clear the title if the master view disappears and set it again if it is shown again:
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
// needed to clear the text in the back navigation:
self.navigationItem.title = " "
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationItem.title = "My Title"
}