iosiphoneswiftipadsplitview

iPad Splitview in Portrait Mastertable as default swift


I'm playing around with Master-Detail out of the box Template. I got it to run and even the Buttons are there on iPhone-Plus. Now I've some issues.

On the iPad and portrait mode the App always starts in DetailView, I found a workaround for at least getting an Back Button but I want to start in portrait mode with the MasterView as TableView(like on iPhone or at least whit master and Detail). When I hit the Back button the table slides in. (in Landscape is everything fine due to the split view)

Question:


Solution

  • I did found a second approach:(for Part 3) After adding the UISplitViewControllerDelegate to the DetailViewController put in the viewDidLoad this self.splitViewController!.preferredDisplayMode = UISplitViewControllerDisplayMode.PrimaryOverlay. That will show both, but the DetailView is NOT adjusted to fit on the right side. If you want to show both Master and Detail (DetailView fit to the right) self.splitViewController!.preferredDisplayMode = UISplitViewControllerDisplayMode.AllVisible

    self.splitViewController!.preferredDisplayMode = UISplitViewControllerDisplayMode.PrimaryOverlay // for overlay Detail will be  hidden half
    self.splitViewController!.preferredDisplayMode = UISplitViewControllerDisplayMode.AllVisible  // detail will fit into right