I try to change the title of the back button of the DetailView which was automatically generated by the MasterViewApp. Tried to change it with the following code:
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Zurück", style: .plain, target: self, action: #selector(backButtonPressed(_:)))
}
@objc
func backButtonPressed(_ sender: UIBarButtonItem) {
self.dismiss(animated: true, completion: nil)
}
The button changed as wished to "Zurück", but the the Master View will not appear. Is there another way to make the title adaption work? Or is there a problem with self.dismiss?