Instance Method


Transitions between two of the view controller'€™s child view controllers.


- (void)transitionFromViewController:(UIViewController *)fromViewController toViewController:(UIViewController *)toViewController duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion;



A view controller whose view is currently visible in the parent'€™s view hierarchy.


A child view controller whose view is not currently in the view hierarchy.


The total duration of the animations, in seconds. If you pass zero, the changes are made without animating them.


A mask of options indicating how you want to perform the animations. For a list of valid constants, see UIViewAnimationOptions.


A block object containing the changes to commit to the views. Here you programmatically change any animatable properties of the views in your view hierarchy. This block takes no parameters and has no return value. This parameter must not be NULL.


A block to be called when the animation completes.

The block takes the following parameters:


YES if the animation finished; NO if it was skipped.


This method adds the second view controller'€™s view to the view hierarchy and then performs the animations defined in your animations block. After the animation completes, it removes the first view controller'€™s view from the view hierarchy.

This method is only intended to be called by an implementation of a custom container view controller. If you override this method, you must call super in your implementation.

See Also

Managing Child View Controllers in a Custom Container


An array of view controllers that are children of the current view controller.

- addChildViewController:

Adds the specified view controller as a child of the current view controller.

- removeFromParentViewController

Removes the view controller from its parent.


Returns a Boolean value indicating whether appearance methods are forwarded to child view controllers.

- beginAppearanceTransition:animated:

Tells a child controller its appearance is about to change.

- endAppearanceTransition

Tells a child controller its appearance has changed.

- setOverrideTraitCollection:forChildViewController:

Changes the traits assigned to the specified child view controller.

- overrideTraitCollectionForChildViewController:

Retrieves the trait collection for a child view controller.


Raised if the view controller hierarchy is inconsistent with the view hierarchy.