@@ -74,7 +74,7 @@ - (NSString *)stringFromAction:(SEL) action {
7474 @" toggleUnderline:" : @" underline" ,
7575 @" _share:" : @" share" ,
7676 };
77-
77+
7878 return map[sel] ?: sel;
7979}
8080
@@ -86,7 +86,7 @@ - (BOOL)canPerformAction:(SEL)action
8686 return NO ;
8787 }
8888 }
89-
89+
9090 if (!self.menuItems ) {
9191 return [super canPerformAction: action withSender: sender];
9292 }
@@ -276,7 +276,7 @@ - (void)startLongPress:(UILongPressGestureRecognizer *)pressSender
276276
277277 UIMenuController *menuController = [UIMenuController sharedMenuController ];
278278 NSMutableArray *menuControllerItems = [NSMutableArray arrayWithCapacity: self .menuItems.count];
279-
279+
280280 for (NSDictionary *menuItem in self.menuItems ) {
281281 NSString *menuItemLabel = [RCTConvert NSString: menuItem[@" label" ]];
282282 NSString *menuItemKey = [RCTConvert NSString: menuItem[@" key" ]];
@@ -535,6 +535,15 @@ - (void)didMoveToWindow
535535 _webView.scrollView .bounces = _pullToRefreshEnabled || _bounces;
536536 _webView.scrollView .showsHorizontalScrollIndicator = _showsHorizontalScrollIndicator;
537537 _webView.scrollView .showsVerticalScrollIndicator = _showsVerticalScrollIndicator;
538+
539+ if ([_indicatorStyle isEqualToString: @" black" ]) {
540+ _webView.scrollView .indicatorStyle = UIScrollViewIndicatorStyleBlack;
541+ } else if ([_indicatorStyle isEqualToString: @" white" ]) {
542+ _webView.scrollView .indicatorStyle = UIScrollViewIndicatorStyleWhite;
543+ } else {
544+ _webView.scrollView .indicatorStyle = UIScrollViewIndicatorStyleDefault;
545+ }
546+
538547 _webView.scrollView .directionalLockEnabled = _directionalLockEnabled;
539548#endif // !TARGET_OS_OSX
540549 _webView.allowsLinkPreview = _allowsLinkPreview;
@@ -852,7 +861,7 @@ - (void)visitSource
852861 [self syncCookiesToWebView: ^{
853862 // Add observer to sync cookies from webview to sharedHTTPCookieStorage
854863 [webView.configuration.websiteDataStore.httpCookieStore addObserver: self ];
855-
864+
856865 // Because of the way React works, as pages redirect, we actually end up
857866 // passing the redirect urls back here, so we ignore them if trying to load
858867 // the same url. We'll expose a call to 'reload' to allow a user to load
@@ -1084,6 +1093,19 @@ - (void)setShowsVerticalScrollIndicator:(BOOL)showsVerticalScrollIndicator
10841093 _showsVerticalScrollIndicator = showsVerticalScrollIndicator;
10851094 _webView.scrollView .showsVerticalScrollIndicator = showsVerticalScrollIndicator;
10861095}
1096+
1097+ - (void )setIndicatorStyle : (NSString *)indicatorStyle
1098+ {
1099+ _indicatorStyle = indicatorStyle;
1100+
1101+ if ([indicatorStyle isEqualToString: @" black" ]) {
1102+ _webView.scrollView .indicatorStyle = UIScrollViewIndicatorStyleBlack;
1103+ } else if ([indicatorStyle isEqualToString: @" white" ]) {
1104+ _webView.scrollView .indicatorStyle = UIScrollViewIndicatorStyleWhite;
1105+ } else {
1106+ _webView.scrollView .indicatorStyle = UIScrollViewIndicatorStyleDefault;
1107+ }
1108+ }
10871109#endif // !TARGET_OS_OSX
10881110
10891111- (void )postMessage : (NSString *)message
@@ -1399,7 +1421,7 @@ - (void) webView:(WKWebView *)webView
13991421}
14001422
14011423/* *
1402- * Called when the web view’ s content process is terminated.
1424+ * Called when the web view' s content process is terminated.
14031425 * @see https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455639-webviewwebcontentprocessdidtermi?language=objc
14041426 */
14051427- (void )webViewWebContentProcessDidTerminate : (WKWebView *)webView
0 commit comments