Ok, I found a solution that seems to work. I tested it on the iPhone 6 and iPhone 6 Plus, but I just opened it thirty minutes ago, so it might have some unfortunate side effect that I haven't confused yet.
It is fast. I hope this is clear. Let me know if you want me to provide it in Objective-C.
if let splitViewController = splitViewController { if splitViewController.collapsed { let viewControllers = splitViewController.viewControllers for controller in viewControllers { // PrimaryNavigationController is the navigation controller I use // as the split views master view, which is also set as its delegate // but it could be any UINavigationController that is the // primary controller of the split view if controller.isKindOfClass(PrimaryNavigationController) { controller.popViewControllerAnimated(true) } } } }
I call this from my detailed view when I want to reject it.
This code works by checking if the controller of the split view is compensated, which is the only state where the popup view of the part makes sense (for me it doesn't matter). He then simply searches for the navigation controller that is currently playing in the split view controller and asks him to put it in the top-level controller. This works because, in collapse mode, the split view view mode is the only view controller on the stack. The detailed view collapses "into" it and, therefore, becomes the current controller of its top view, thus the one that appears.
It seems to need work. Let me know if this is for you too.
source share