How to change the back button text on a UINavigationController

In Your Storyboard

I didn’t know the storyboard could do this, but it can:

Select the Navigation Bar in question, then check the Attributes Inspector:

Screen Shot 2013-03-03 at 19.19.25

In Code

To set the title in code, you need to address the self.navigationItem.backBarButton property of your view controller and pass it a new UIBarButtonItem. Here’s one way of doing it:

This content is for members only.



One thought on “How to change the back button text on a UINavigationController

  1. I’ve recently tried this when pushing a view controller onto the stack from code via a delegate – in which case the above didn’t work for me.

    Here’s another option, which will work even on the current view (rather than in the one before):

    self.navigationController.navigationBar.topItem.title = @"Hey Now!";
    

    Note that this is an undesirable hack:
    Even though it works, all other view controllers pushed after the back button has been changed will ALL default to this title. Use with caution!

Leave a Reply