Created
March 26, 2012 16:33
-
-
Save remear/2206360 to your computer and use it in GitHub Desktop.
How viewWillDisappear
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewWillDisappear:(BOOL)animated { | |
NSArray *viewControllers = self.navigationController.viewControllers; | |
if (viewControllers.count > 1 && [viewControllers objectAtIndex:viewControllers.count-2] == self) { | |
// View is disappearing because a new view controller was pushed onto the stack | |
NSLog(@"New view controller was pushed"); | |
} else if ([viewControllers indexOfObject:self] == NSNotFound) { | |
// View is disappearing because it was popped from the stack | |
NSLog(@"View controller was popped"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment