How can I remove a title from back button in navigation bar, but I want to keep the arrow.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With