Search code examples
iosswiftuisplitviewcontroller

SplitViewController shows detail iPad Pro portrait mode


SplitViewController shows only detail controller at first launch in iPad Pro Portrait mode

It should be display both master and detail controller together in portrait mode

Preview:

Before Dragging (first time launch app)

Before Dragging After dragging from left side

After dragging from left side

Help me as i am using split controller very first time

Thank you in advance


Solution

  • Please try this in your DetailViewController

    override func viewWillAppear(_ animated: Bool) {
            self.splitViewController?.preferredDisplayMode = .allVisible
        }
    

    Thanks!