Ans :
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.
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.
No comments:
Post a Comment
Thanks