UISplitViewController pushes new detail controller, doesn't update side detail

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

Answered by MegaWatt in 280595022

Found my problem. Seems copying the views changed the segue type from showDetails to show.

Accepted Answer

Found my problem. Seems copying the views changed the segue type from showDetails to show.

UISplitViewController pushes new detail controller, doesn't update side detail
 
 
Q