When I push a new ViewController onto a navigation controller stack the “back” button is the Title of the previous controller.
How can I change the text in the back button to “Back” instead of the default name-of-last-controller?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can actually set the title on the main view controller’s
navigationItem‘s title. Basically eachUIViewControllerhas a little stubUINavigationItemwhich contains metadata about how that view should be referenced inside aUINavigationController. By default, that metadata just falls back to theUIViewControlleritself.Assuming ‘self’ is the
UIViewControllerof the view that’s visible inside theUINavigationController, set: