popToRootController
popToRootController is a method found in Apple's UIKit framework, specifically within the UINavigationController class. Its primary function is to dismiss view controllers from the navigation stack until only the root view controller remains. When this method is called, the navigation controller will animate the removal of all view controllers that are currently on top of the root view controller, effectively resetting the navigation stack to its initial state.
This operation is commonly used when a user needs to navigate back to the very beginning of
The method returns an array of the view controllers that were popped from the stack. If the