Quantcast
Channel: Developer Feed - Snippet
Viewing all articles
Browse latest Browse all 178

How do you hide the back button in UINavigationController?

$
0
0

Whenever a child view is pushed into the Navigation Controller, a back button on the top left of the page is displayed. Using this button the user can go back to the parent view. In some case we like not to display that button e.g. if we want to add an Cancel and Save button on the screen. Cancel acts like a back button and does not save anything. The Save button does validation and saves the data.In this case we don't want user to simply touch the Back button and go back to parent view.

It is a single line of code that can be added in the viewDidLoad method to hide the back button in UINavgiation Bar is as follows.

  1. [ self.navigationItemsetHidesBackButton:YES animated:YES];

Viewing all articles
Browse latest Browse all 178

Trending Articles