Stan Ostrovskiy
1 min readSep 18, 2016

--

If you use a Navigation Controller and want to pop all ViewControllers up to the root ViewController:

navigationController?.popToRootViewController(animated: true)

If you don’t have a Navigation Controller and use dismissViewController method, you still can dismiss all ViewControllers to show the root ViewController:

view.window?.rootViewController?.dismiss(animated: true, completion: nil)

--

--

Stan Ostrovskiy
Stan Ostrovskiy

Responses (1)