diff --git a/SafariViewManager.m b/SafariViewManager.m index c1b01c3..e04d628 100644 --- a/SafariViewManager.m +++ b/SafariViewManager.m @@ -17,6 +17,7 @@ RCT_EXPORT_MODULE() RCT_EXPORT_METHOD(show:(NSDictionary *)args callback:(RCTResponseSenderBlock)callback) { UIColor *tintColorString = args[@"tintColor"]; + BOOL fromBottom = [args[@"fromBottom"] boolValue]; // Error if no url is passed if (!args[@"url"]) { @@ -34,6 +35,11 @@ RCT_EXPORT_METHOD(show:(NSDictionary *)args callback:(RCTResponseSenderBlock)cal [self.safariView.view setTintColor:tintColor]; } + // Set modal transition style + if(fromBottom) { + self.safariView.modalPresentationStyle = UIModalPresentationOverFullScreen; + } + // Display the Safari View UIViewController *ctrl = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; [ctrl presentViewController:self.safariView animated:YES completion:nil]; diff --git a/examples/SafariViewExample/index.ios.js b/examples/SafariViewExample/index.ios.js index 496622a..e61e5d3 100644 --- a/examples/SafariViewExample/index.ios.js +++ b/examples/SafariViewExample/index.ios.js @@ -65,7 +65,8 @@ class SafariViewExample extends Component { SafariView.show({ url: 'http://twitter.com/naoufal', readerMode: true, - tintColor: "rgb(0, 0, 0)" + tintColor: "rgb(0, 0, 0)", + fromBottom: true }); }