I would like to change the BackBarButtonItem
on all the views in my iOS app so that they show just the back arrow with no text.
Is the only way to accomplish this is to go through every UIViewController and set the self.navigationItem.backBarButtonItem.title
? Seems I should be able to create a superclass to define the default value of backBarButtonItem.title
, but I am not sure where to start.
Thank you for your help.
You don't need to change it on every view controller class. You can either sublcass it and change once, or you can do it in your app delegate.
If you want to subclass the Navigation Bar, you can simple set the back button with text @"":
If you want to do it in the app delegate you can do it in two ways:
One way is to set the button text color as clear color:
Another way is to position the back button away from the screen, so user can't see it
we can implement delegate function of navigation controller and set delegate for view controller implementing this function:
1)
navigationController.delegate = yourViewController
2) Delegate function :
This will remove backbutton title text of all following view controllers