1
votes

I have a FlyoutNavigation component which derives from UISplitViewController, So when I show it in ipad portrait mode, the master view hides by default and I can toggle it properly, but when I change the orientation to landscape the Masterview shows all the time and I cannot even Toggle it.

Is there a way I can hide/unhide it?

2

2 Answers

2
votes

Try setting

splitViewController.preferredDisplayMode = UISplitViewControllerDisplayModePrimaryHidden

1
votes

Try in appDelegate like this :

guard let splitViewController = window?.rootViewController as? UISplitViewController  
else { fatalError() }

splitViewController.preferredDisplayMode = .primaryHidden