How can I remove a title from back button in navigation bar, but I want to keep the arrow.
Asked
Active
Viewed 3,413 times
2 Answers
8
Set the title text to an empty string.
navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .Plain, target: nil, action: nil)
Edit: As per comments below this will only work if you set the back button before you segue to the view controller with the button in it.

yesthisisjoe
- 1,987
- 2
- 16
- 32
-
6
-
-
3You'll need to set it before you segue to the destinationViewController. You'll probably want to do it in prepareForSegue on the VC originating the segue. – Adrian Feb 23 '16 at 15:42
3
If you do not need the title, do this in viewDidLoad
of your previous ViewController
title = ""
If you need the title
for first ViewController
, toggle setTitle
between viewWillAppear
and viewWillDisAppear
of previous viewController
will do.

Warif Akhand Rishi
- 23,920
- 8
- 80
- 107