I have root ViewController and detailed ViewController. When i push to detailedViewController i get leftBarButtonItem with the title from the root one. But i want the title to be just “Back”, nothing more. So how to do that?
This doesn’t help
self.navigationItem.leftBarButtonItem.title = @"Back";
To create my on type barButtonItem(for example 104 with left arrow) and to set it to leftBarButtonItem is terrible decision.
Is there other way than to change the title of the rootViewController manually before pushing?
From Apple’s doc:
So, you can create create your barButtonItem (e.g.
– initWithTitle:style:target:action:) and assign it to that property.In addition, if you want to have a custom image for
UIBarButtonItem(left or right) I suggest you to create a category extension like the following:and then use it as