Instance Method

didMoveToParentViewController:

Called after the view controller is added or removed from a container view controller.

Declaration

- (void)didMoveToParentViewController:(UIViewController *)parent;

Parameters

parent

The parent view controller, or nil if there is no parent.

Discussion

Your view controller can override this method when it wants to react to being added to a container.

If you are implementing your own container view controller, it must call the didMoveToParentViewController: method of the child view controller after the transition to the new controller is complete or, if there is no transition, immediately after calling the addChildViewController: method.

The removeFromParentViewController method automatically calls the didMoveToParentViewController: method of the child view controller after it removes the child.

See Also

Responding to Containment Events

- willMoveToParentViewController:

Called just before the view controller is added or removed from a container view controller.