I'm trying to add a split view controller to my existing project so that it shows over the existing content in a new window.
The template project from Apple works as expected. For testing, I simply copied the storyboard items from the template project onto my own storyboard, gave the splitViewController a storyboard identifier and copied the classes.
When a plus phone is turned landscape it shows the master and detail side-by-side properly. However, when I tap on a master entry it pushes a *new* detail controller instance over the master content instead of using the secondary detail view on the right for the content.
This is how I show show the splitViewController:
guard let splitViewController = storyboard.instantiateViewController(withIdentifier: "MasterViewController") as? UISplitViewController else { return }
splitViewController.delegate = self
splitViewController.preferredDisplayMode = .automatic
self.conversationWindow = UIWindow(frame: UIScreen.main.bounds)
self.conversationWindow?.windowLevel = UIWindowLevelNormal + 0.1
self.conversationWindow?.rootViewController = splitViewController
self.conversationWindow?.makeKeyAndVisible()Anyone ever experience this?
Also posted here with images: https://stackoverflow.com/questions/47559230/uisplitviewcontroller-pushes-new-detail-controller-doesnt-update-side-detail