I have 2 View Controllers with Navigation Controller.
When I Use [self.navigationController popViewControllerAnimated:YES];
in the second one - the first one opens but the methods in viewDidLoad don't called. What are the methods called in the first one controller in this situation?
NavController manages app navigation within a NavHost . Apps will generally obtain a controller directly from a host, or by using one of the utility methods on the Navigation class rather than create a controller directly. Navigation flows and destinations are determined by the navigation graph owned by the controller.
Please navigate to Advanced Website Kiosk Settings–>Navigation–>Disable back button. Kindly enable this restriction to disallow the usage of the back button on the iOS device.
The navigation controller sends viewWillAppear:
to a view controller before putting its view on the screen, and viewDidAppear:
after.
Inside viewWillAppear:
and viewDidAppear:
, the view controller can check self.isMovingToParentViewController
. If isMovingToParentViewController
is YES
, the view controller is being added to the navigation controller in the first place (presumably because it's the navigation controller's root view controller, or because it is being pushed). If isMovingToParentViewController
is NO
, the view controller is already in the navigation controller's stack, and another view controller is being popped to reveal it.
Read “Handling View-Related Notifications” in the UIViewController
class reference.
In that case viewWillAppear
method will be called.
-(void)viewWillAppear:(BOOL)animated
{
}
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