Swift renaming the back navigation item

后端 未结 2 1608
北海茫月
北海茫月 2021-01-23 13:07

I\'m trying to edit the tile of the back item in the navigation controller.

I have this scene, Navigation Controller -> Table View Controller ->

2条回答
  •  执念已碎
    2021-01-23 13:51

    The backBarButtonItem works for the view controller that you are going back TO not the one you are going back FROM.

    So, in your case in the first view controller you can have the code...

    navigationItem.backBarButtonItem = UIBarButtonItem(title: "Some title", style: .done, target: nil, action: nil)
    

提交回复
热议问题