Ok, this is a weird one.
In iOS 8, if a popover is presented from the master panel in a UISplitViewController while in portrait, rotation is disabled. I've run through a bunch of tests and confirmed this is the case.
There's a private method on UISplitViewController, _shouldPreventAutorotation, that gets called when rotating and inspects the presentationController property on the popover's content controller. If this returns a non-nil value, rotation is disabled. If you override the property and return nil, rotation is once again enabled.
Does anyone have any idea why this behaviour was added in iOS 8?
I uploaded test project that demonstrates this behaviour here.
So, after some more investigation and decompiling in Hopper, there's a private method on UISplitViewController that gets called when the device is rotated that determines whether or not rotation should be disabled.
If the master panel is visible, the master panel has a child modal view controller (in this case a popover), and the presented popover's presentationController property returns a non-nil value, then rotation is disabled.
I can override this behaviour by overriding -presentationController on the popover's controller, and return nil. Not sure about any side effects yet but it works.
- (UIPresentationController *)presentationController {
return nil;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With