Search code examples
iosswiftuisplitviewcontroller

How to go back to root view controller in uisplitviewcontroller like "Settings" app in iPad?


In the "settings" app of iPad, if u click on "General" > "About", then click on "General" at the side. The "About" page will jump back to root view controller.

How do I achieve that in swift?

I'm currently using self.splitViewController?.showDetailViewController on click at "masterview"


Solution

  • Can you try this?

    self.splitViewController?.navigationController?.popToRootViewController(animated: true)