Instance Method

popToRootViewControllerAnimated:

Pops all the view controllers on the stack except the root view controller and updates the display.

Declaration

- (NSArray<__kindof UIViewController *> *)popToRootViewControllerAnimated:(BOOL)animated;

Parameters

animated

Set this value to YES to animate the transition. Pass NO if you are setting up a navigation controller before its view is displayed.

Return Value

An array of view controllers representing the items that were popped from the stack.

Discussion

The root view controller becomes the top view controller. For information on how the navigation bar is updated, see Updating the Navigation Bar.

See Also

Pushing and Popping Stack Items

- pushViewController:animated:

Pushes a view controller onto the receiver’s stack and updates the display.

- popViewControllerAnimated:

Pops the top view controller from the navigation stack and updates the display.

- popToViewController:animated:

Pops view controllers until the specified view controller is at the top of the navigation stack.

interactivePopGestureRecognizer

The gesture recognizer responsible for popping the top view controller off the navigation stack.