I am having Master-Detail template containing UISplitViewController. For plus size Iphone landscape mode, splitviewcontroller automatically splits the view in 2 parts. Left side as Master view controller and right side with detailed viewcontroller.
This scenerio dosen't work with IPhone 5,6,8,X, it works for plus size like IPhone 6+ , 8 + etc.
Below is the code for SplitView delegate method.
func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController:UIViewController, onto primaryViewController:UIViewController) -> Bool
guard let secondaryAsNavController = secondaryViewController as? UINavigationController else { return false }
guard let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController else { return false }
if topAsDetailController.selectedEvent == nil {
// Return true to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded.
return true
}
return false