Alexander Deplov – Senior Product Designer Blog

How to Make Custom UINavigationController Back Button Image Without Title (Swift)

· Alexander Deplov

The easiest way to customize navigation controller back button.

By default back button looks like this:

We are going to make it looks like Instagram back button (without text):

I quickly redraw the button in the Sketch and add into Assets:

Storyboard looks like this:

In the ViewController.swift write:

override func viewDidLoad() {
    super.viewDidLoad()

    if let backButtonImage = UIImage(named: "backButton") {  
        navigationController?.navigationBar.backIndicatorImage = backButtonImage
        navigationController?.navigationBar.backIndicatorTransitionMaskImage = backButtonImage
    }

    navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
}

Result:

This technique used in our new version (currently in development) of Anchor Pointer: GPS compass for iPhone.

Let's connect on LinkedIn!