Skip to content

Commit 91abe05

Browse files
committed
Resolve iOS7 compatibility issues again
1 parent e6f95f8 commit 91abe05

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

FEPopupMenuController/FEPopupMenuController.m

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,20 @@ -(void)showInViewController:(UIViewController *)viewController atPosition:(CGPoi
8787
[self.tableView reloadData];
8888

8989
// present style
90-
self.modalPresentationStyle = UIModalPresentationCustom;
91-
self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
90+
if (floor(NSFoundationVersionNumber) >= NSFoundationVersionNumber_iOS_8_0) {
91+
// iOS8+
92+
self.modalPresentationStyle = UIModalPresentationCustom;
93+
self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
94+
}else{
95+
// iOS7
96+
UIViewController *root = viewController;
97+
while (root.parentViewController) {
98+
root = root.parentViewController;
99+
}
100+
root.modalPresentationStyle = UIModalPresentationCurrentContext;
101+
}
92102

103+
self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
93104
[viewController presentViewController:self animated:YES completion:nil];
94105
}
95106

0 commit comments

Comments
 (0)