Merge pull request #53 from Amwam/bugfix/modal-presentation

Fixed Safari view not being presentable from a modal
This commit is contained in:
Koen Punt
2017-10-01 16:27:18 +02:00
committed by GitHub

View File

@@ -70,8 +70,14 @@ RCT_EXPORT_METHOD(show:(NSDictionary *)args callback:(RCTResponseSenderBlock)cal
self.safariView.modalPresentationStyle = UIModalPresentationOverFullScreen;
}
// Display the Safari View
UIViewController *ctrl = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
// Cycle through view controllers to get the view closest to the foreground
while (ctrl.presentedViewController && !ctrl.isBeingDismissed) {
ctrl = ctrl.presentedViewController;
}
// Display the Safari View
[ctrl presentViewController:self.safariView animated:YES completion:nil];
if (hasListeners) {