How can I know when a UIViewController has been just pushed from a UINavigationViewController ?
I obviously don't want to use viewDidAppear because that's method is called everytime that view appears, not just when it's pushed.
viewDidLoad is called before the view controller is pushed and I don't have the reference to the navigationController available
You can check this from of navigation viewcontrollers array
//Eg:
//Maintain your navigation object:
@property (strong, nonatomic) UINavigationController *navController;
//use:
if([[self.navController.viewControllers lastObject] class] == [your view controoler class]) {
// your view controller is present in navigation stack
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With