0

I have a splitview with Master (showing table view) and Details (Showing detail data). When I launch my app it shows detailview first with no data but I need to show masterview first.

I know that there are some answers but nothing works for me.

storyboard

Any solution?

Ahmad F
  • 30,560
  • 17
  • 97
  • 143
Phyber
  • 1,368
  • 11
  • 25

1 Answers1

1

Try this:

class MySplitViewControllerShowingMasterViewFirst: UISplitViewController, UISplitViewControllerDelegate {        
    override func viewDidLoad() {
        super.viewDidLoad()
        self.delegate = self
    }

    func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController: UIViewController, onto primaryViewController: UIViewController) -> Bool {
        return true
    }
}
Roman Aliyev
  • 224
  • 2
  • 7
  • I tried this before but it works now ! Don't know why it didn't work before :D . Thanks a lot – Phyber Mar 26 '17 at 10:23