iOS 13 UISplitView Problems

后端 未结 8 1205
情话喂你
情话喂你 2021-01-02 14:00

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 p

8条回答
  •  抹茶落季
    2021-01-02 14:35

    Warren Milward's answer helped me to guide me in the right direction, but actually I got it working with viewDidLoad().

    I ended up using a subclass for the UISplitViewController and set the required values in viewDidLoad() as well as the delegate calls here.

    class CustomSplitViewController: UISplitViewController, UISplitViewControllerDelegate {
    
        override func viewDidLoad() {
            super.viewDidLoad()
    
            self.delegate = self
            self.preferredDisplayMode = .allVisible
        }
    
        func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController: UIViewController, onto primaryViewController: UIViewController) -> Bool {
            return true
        }
    }
    

提交回复
热议问题