Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save steipete/72e4370c6de1ff410a70 to your computer and use it in GitHub Desktop.
Save steipete/72e4370c6de1ff410a70 to your computer and use it in GitHub Desktop.
// This is more hacky than it should be!
- (UIModalPresentationStyle)pspdf_currentPresentationStyle {
UIViewController *vc = self.presentedViewController.presentingViewController;
if (vc.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassCompact) {
UIModalPresentationStyle style = self.adaptivePresentationStyle;
if (style != UIModalPresentationNone) {
return style;
}
}
return self.presentationStyle;
}
- (BOOL)pspdf_isPopover {
return self.pspdf_currentPresentationStyle == UIModalPresentationPopover;
}
@douglashill
Copy link

Fixed for iPhone 6 Plus in landscape (where popover presentations adapt to sheets) in my fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment