Remove text from Back button keeping the icon

I know this already has an answer, but you can also do it in code (in case you’re working with nibs)

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

Add the above in the first view controller.

Note that you need to do this for each view controller that is pushing. So if you have 3 view controllers, and you want to remove the back text from all of them, you’ll have to add the line in view controller 1 and 2.

Leave a Comment