Instance Property

viewControllers

The view controllers currently on the navigation stack.

Declaration

@property(nonatomic, copy) NSArray<__kindof UIViewController *> *viewControllers;

Discussion

The root view controller is at index 0 in the array, the back view controller is at index n-2, and the top controller is at index n-1, where n is the number of items in the array.

Assigning a new array of view controllers to this property is equivalent to calling the setViewControllers:animated: method with the animated parameter set to NO.

See Also

Accessing Items on the Navigation Stack

topViewController

The view controller at the top of the navigation stack.

visibleViewController

The view controller associated with the currently visible view in the navigation interface.

- setViewControllers:animated:

Replaces the view controllers currently managed by the navigation controller with the specified items.