backBarButtonItem in iOS (Swift)

ios, swift

Solution

The method that Yogesh Suthar said will replace the whole back button, so you will not have the default left arrow sign! I suggest to use this code:

navigationController?.navigationBar.topItem?.backBarButtonItem = backButton

Problem

``` var backButton: UIBarButtonItem = UIBarButtonItem(title: "CUSTOM", style: UIBarButtonItemStyle.Bordered, target: self, action: nil) newNavigationItem.backBarButtonItem = backButton ``` Where is `newNavigationItem: UINavigationItem` I want custom back title. It shows "Back" text or "Title of last view". So it does not work. Why?

Original source

Related problems