Detect back button touch on UINavigationController


/ Published in: iPhone
Save to your folder(s)

Code taken from comment by 'William Jockusch' in the URL.


Copy this code and paste it in your HTML
  1. -(void) viewWillDisappear:(BOOL)animated {
  2. if ([self.navigationController.viewControllers indexOfObject:self]==NSNotFound) {
  3. // back button was pressed. We know this is true because self is no longer
  4. // in the navigation stack.
  5. }
  6. [super viewWillDisappear:animated];
  7. }

URL: http://www.comanswer.com/question/setting-action-for-back-button-in-navigation-controller

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.