Navigation Bar
Back Button
User Interface
App Development
iOS Development

How do I change the title of the back button on a Navigation Bar

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

In UIKit, the text shown on the back button usually comes from the previous view controller, not the one currently being pushed. That detail is the main reason developers set the title in the wrong place and think the API is not working.

Set the Back Button Title on the Previous View Controller

If you are pushing DetailsViewController from HomeViewController, the back button shown on the details screen is configured from HomeViewController.

swift
1import UIKit
2
3final class HomeViewController: UIViewController {
4    override func viewDidLoad() {
5        super.viewDidLoad()
6        navigationItem.backBarButtonItem = UIBarButtonItem(
7            title: "Back",
8            style: .plain,
9            target: nil,
10            action: nil
11        )
12    }
13}

When the next screen is pushed, its back button will display Back instead of the previous view controller title.

Use backButtonTitle on Newer iOS Versions

If you only want to change the title and do not need a full custom bar button item, the lighter API is often clearer.

swift
1import UIKit
2
3final class HomeViewController: UIViewController {
4    override func viewDidLoad() {
5        super.viewDidLoad()
6        navigationItem.backButtonTitle = "Back"
7    }
8}

This is usually the most direct solution for modern UIKit code.

Do Not Replace the Left Bar Button Lightly

Developers sometimes create a custom leftBarButtonItem on the pushed view controller. That can visually change the button, but it also replaces the system back behavior unless you reimplement navigation manually.

swift
1navigationItem.leftBarButtonItem = UIBarButtonItem(
2    title: "Cancel",
3    style: .plain,
4    target: self,
5    action: #selector(closeScreen)
6)

That is fine when you really want custom behavior, but it is not the same thing as simply renaming the standard back button.

Global Appearance Options Exist Too

If you want to hide or standardize back button titles across the app, UINavigationBarAppearance and related appearance settings may be more appropriate than changing each screen individually. The right choice depends on whether the title should be local to one navigation step or part of the app-wide visual style.

Remember the Source of the Label

The most useful mental model is:

  • current screen owns its title,
  • previous screen influences the next screen’s back button text.

Once that is clear, the API feels much less surprising.

SwiftUI and UIKit Are Different Here

This topic is specifically about UIKit navigation bars. In SwiftUI, back-button customization follows different rules and is often tied to navigation container behavior and toolbar customization rather than navigationItem.backBarButtonItem. Mixing the two mental models is a common source of confusion in apps that use both frameworks.

Common Pitfalls

  • Setting the back button title on the destination view controller instead of the source view controller.
  • Replacing the left bar button item when only the label needed to change.
  • Forgetting that a custom left button can bypass the default interactive back behavior.
  • Mixing app-wide appearance customization with one-screen-specific behavior.
  • Testing only one navigation path when the same view controller can be reached from multiple sources.

Summary

  • The back button label usually comes from the previous view controller’s navigation item.
  • Use backButtonTitle or backBarButtonItem on the source screen to change it.
  • Custom leftBarButtonItem is a different technique with different behavior.
  • Global navigation appearance is better for app-wide styling choices.
  • Most back-button title bugs come from configuring the wrong view controller.
  • Source and destination roles matter more than the API name suggests.
  • Configure the navigation stack intentionally when one screen has multiple entry paths.

Course illustration
Course illustration

All Rights Reserved.