Reputation: 807
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?
Upvotes: 1
Views: 491
Reputation: 258
Try in appDelegate like this :
guard let splitViewController = window?.rootViewController as? UISplitViewController
else { fatalError() }
splitViewController.preferredDisplayMode = .primaryHidden
Upvotes: 1
Reputation: 698
Try setting
splitViewController.preferredDisplayMode = UISplitViewControllerDisplayModePrimaryHidden
Upvotes: 2