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)
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 :/
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 inviewDidLoad()
as well as the delegate calls here.For those who use storyboard and configure the new controller in a subclass from UIStoryboardSegue, it'll be simpler:
just before
[source presentViewController:destination animated:YES completion:nil];
, just setdestination.modalPresentationStyle = UIModalPresentationFullScreen;
, because the default is nowUIModalPresentationPageSheet
.I set the spliteViewController's delegate on appdelegate, and it worked
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 inawakeFromNib
method. Now it is working as expected.did you try this one (UISplitViewControllerDelegate):
&
Try
MasterViewController_Instance.view.layoutIfNeeded()
insideSplitviewcontroller ViewDidLoad()
method. It fixed my problem.