Instance Method

viewWillDisappear:

Notifies the view controller that its view is about to be removed from a view hierarchy.

Declaration

- (void)viewWillDisappear:(BOOL)animated;

Parameters

animated

If YES, the disappearance of the view is being animated.

Discussion

This method is called in response to a view being removed from a view hierarchy. This method is called before the view is actually removed and before any animations are configured.

Subclasses can override this method and use it to commit editing changes, resign the first responder status of the view, or perform other relevant tasks. For example, you might use this method to revert changes to the orientation or style of the status bar that were made in the viewDidAppear: method when the view was first presented. If you override this method, you must call super at some point in your implementation.

See Also

Responding to View-Related Events

- viewWillAppear:

Notifies the view controller that its view is about to be added to a view hierarchy.

- viewDidAppear:

Notifies the view controller that its view was added to a view hierarchy.

- viewDidDisappear:

Notifies the view controller that its view was removed from a view hierarchy.

beingDismissed

A Boolean value indicating whether the view controller is being dismissed.

beingPresented

A Boolean value indicating whether the view controller is being presented.

movingFromParentViewController

A Boolean value indicating whether the view controller is being removed from a parent view controller.

movingToParentViewController

A Boolean value indicating whether the view controller is being moved to a parent view controller.