Can't dismiss UISplitViewController presented modally in primaryOverlay mode

83 views Asked by At

I have a modally presented UISplitViewController, and added a IBAction button on master view controller to dismiss them all. When the displayMode is allVisible, it works just fine:

self.presentingViewController?.dismiss(animated: true, completion: nil)

But when the displayMode is primaryOverlay, the line of code above doesn't work. So I tried this:

self.navigationController?.splitViewController.dismiss(animated: true, completion: nil)

but it only dismisses the detail view controller leaving the master.

0

There are 0 answers