UIModalPresentationPopover for iPhone 6 Plus in landscape doesn't display popover
Implement the new adaptivePresentationStyleForPresentationController:traitCollection:
method of UIAdaptivePresentationControllerDelegate
:
- (UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller traitCollection:(UITraitCollection *)traitCollection {
// This method is called in iOS 8.3 or later regardless of trait collection, in which case use the original presentation style (UIModalPresentationNone signals no adaptation)
return UIModalPresentationNone;
}
UIModalPresentationNone
tells the presentation controller to use the original presentation style which in your case will display a popover.
In Swift 3, if you implemented the original adaptivePresentationStyle
method, simply adding this code works:
func adaptivePresentationStyle(for controller: UIPresentationController, traitCollection: UITraitCollection) -> UIModalPresentationStyle {
return adaptivePresentationStyle(for: controller)
}