Ios – UINavigationController “back button” custom text

iosiphoneuinavigationcontroller

The "back button" of a UINavigationController by default shows the title of the last view in the stack. Is there a way to have custom text in the back button instead?

Best Answer

From this link:

self.navigationItem.backBarButtonItem =
   [[UIBarButtonItem alloc] initWithTitle:@"Custom Title"
            style:UIBarButtonItemStylePlain
           target:nil
           action:nil];

As Tyler said in the comments:

don't do this in the visible view controller, but in the view controller that you'd see if you hit the back button