Scenario
I have an application with a navigation controller. When the navigation controller pushes another controller onto the stack, the back button "<(name of the last view controller)" is displayed in the upper left corner of the screen.
What I need
I need something like (pseudo-code) ...
-(void)detectedBackButtonWasPushed { NSLog(@"Back Button Pressed");
Question
Since this button is created by the navigation controller, and I did not create this button in the storyboards, how can I return the back button to a method like this?
examples of what Eve tried for Oleg
-(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { UIViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"notification"]; if (viewController == vc) { NSLog(@"BACK BUTTON PRESSED"); } }
Is that how I should do it? The reason for this is not working.
source share