popToViewController(_:animated:)
Pops view controllers until the specified view controller is at the top of the navigation stack.
Declaration
func popToViewController(_ viewController: UIViewController, animated: Bool) -> [UIViewController]?Parameters
Return Value
An array containing the view controllers that were popped from the stack.
Discussion
For information on how the navigation bar is updated, see Updating the navigation bar.