From 57f2c0ea95d50735e7c29ab69512fa3294000a61 Mon Sep 17 00:00:00 2001 From: Alma Madsen Date: Thu, 29 Jun 2017 14:42:55 -0700 Subject: [PATCH 1/2] added support for formSheet and pageSheet presentation style --- RCTBrowser.m | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/RCTBrowser.m b/RCTBrowser.m index 0c86e6e..da90c79 100644 --- a/RCTBrowser.m +++ b/RCTBrowser.m @@ -45,6 +45,17 @@ @implementation RCTBrowser UIViewController *rootVC = [[UIApplication sharedApplication] keyWindow].rootViewController; UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:webVC]; + [options enumerateKeysAndObjectsUsingBlock:^(NSString* key, id obj, BOOL *stop) { + if ([key isEqualToString:@"presentationStyle"]) { + if ([obj isEqual: @"formSheet"]) { + nav.modalPresentationStyle = UIModalPresentationFormSheet; + } + else if ([obj isEqual: @"pageSheet"]) { + nav.modalPresentationStyle = UIModalPresentationPageSheet; + } + } + }]; + dispatch_async(dispatch_get_main_queue(), ^{ [rootVC presentViewController:nav animated:YES completion: nil]; }); From d7e5a8f64658a75b48ad442aaade5e5388ac1e8f Mon Sep 17 00:00:00 2001 From: Alma Madsen Date: Thu, 29 Jun 2017 15:05:50 -0700 Subject: [PATCH 2/2] updated README --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index cf5fd5b..d949fd4 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,17 @@ Browser.open('https://google.com/', { hideWebViewBoundaries: false, buttonTintColor: processColor('#d64bbd') }); + +// To change the presentation style from the default, you can additionally pass in: +Browser.open('https://google.com/', { + presentationStyle: 'formSheet' // can be one of [undefined, 'pageSheet', 'formSheet'] + }); +// For differences, see: +// https://developer.apple.com/library/content/featuredarticles/ViewControllerPGforiPhoneOS/PresentingaViewController.html ``` + + [Descriptions of options and their defaults](https://github.com/TimOliver/TOWebViewController/blob/master/TOWebViewController/TOWebViewController.h) ### TODOs