Having adopted the new UISplitViewController , I am trying to change the default behavior that occurs when using the UISplitViewControllerDisplayModeAutomatic mode.
When working on a portrait, I want the main overlay to be hidden when the user invokes clicking on the side of the part. By default, the overlay remains on the screen until the user navigates to the part.
I tried using the delegate as follows:
- (BOOL)splitViewController:(UISplitViewController *)splitViewController showDetailViewController:(UIViewController *)vc sender:(id)sender { if (splitViewController.displayMode == UISplitViewControllerDisplayModePrimaryOverlay) { [UIView animateWithDuration:0.3 animations:^{ splitViewController.preferredDisplayMode = UISplitViewControllerDisplayModePrimaryHidden; }]; } return NO; }
This gives me the desired behavior in the portrait, but it violates the landscape mode (which I want to conduct as UISplitViewControllerDisplayModeAllVisible ). If you click and then rotate the device, the left side is still hidden (as expected). I canโt find an appriprite place to connect, to re-set my preferred rotation mode to show the left side (since the tag collections cannot be used to tell the landscape and portrait on the iPad).
How can I manually trigger an overlay dismissal?
Dupe Note: iOS8 completely changed the UISplitViewController , so all the other SO answers until June 14 are probably erroneous (and I broke through many of them, just incase)
ios ios8 ios-universal-app screen-rotation uisplitviewcontroller
Parrots
source share