Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 13 UISplitView Problems

On iOS 13 Beta 5, I currently have problems with my UISplitView on iPhones.

My app starts with the detailsview off my splitview not with my masterview (look at the picture) detailview

Does anyone know how i can fixed this problem under iOS 13? On iOS 12 everything works like a charm ☹️

Thx in advance Sebastian


Edit:

Sorry for the late answer I was on a short holiday trip without any internet :/

my Class looks like this:


class MyClass : UITableViewController, UISplitViewControllerDelegate, UIPickerViewDelegate {

override func viewDidLoad() {
        super.viewDidLoad()

        if (UIDevice.current.userInterfaceIdiom == .pad){
            navigationController?.navigationBar.isTranslucent = false
        }

        /*SplitView*/

        splitViewController?.preferredDisplayMode = .allVisible
        splitViewController?.delegate = self

        self.definesPresentationContext = true

}

    // SplitView
    func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController: UIViewController, onto primaryViewController: UIViewController) -> Bool {
        return true
    }

}


I think it's look like the normal procedure for this problem :/

like image 207
Sebastian R. Avatar asked Aug 04 '19 19:08

Sebastian R.


Video Answer


1 Answers

I had the same issue.

After a bit of investigation it seems like viewDidLoad is too late to set it to all visible.

I subclassed the UISplitViewController and changed the setting in awakeFromNib method. Now it is working as expected.

like image 109
Warren Milward Avatar answered Oct 19 '22 11:10

Warren Milward