diff --git a/RCTBrowser.m b/RCTBrowser.m index be343de..82d91cc 100644 --- a/RCTBrowser.m +++ b/RCTBrowser.m @@ -59,7 +59,13 @@ @implementation RCTBrowser [nav.navigationBar setTitleTextAttributes: @{NSForegroundColorAttributeName:color}]; - } + } else 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(), ^{ diff --git a/README.md b/README.md index 980a375..ccebdba 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,17 @@ Browser.open('https://google.com/', { titleTintColor: processColor('#d64bbd'), barTintColor: 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