fix(iOS): Xcode issues and warnings (no functionality changes) (#860)

* Fix Xcode warnings (enums, whitespace, string literals)

* Add nullability notations
This commit is contained in:
jnpdx 2019-09-23 01:49:06 -07:00 committed by Thibault Malbranche
parent ac500b391b
commit 6cfdd4b88c
2 changed files with 18 additions and 18 deletions

View File

@ -13,18 +13,18 @@
@protocol RNCWebViewDelegate <NSObject>
- (BOOL)webView:(RNCWebView *)webView
shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
withCallback:(RCTDirectEventBlock)callback;
- (BOOL)webView:(RNCWebView *_Nonnull)webView
shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *_Nonnull)request
withCallback:(RCTDirectEventBlock _Nonnull)callback;
@end
@interface RNCWebView : RCTView
@property (nonatomic, weak) id<RNCWebViewDelegate> delegate;
@property (nonatomic, copy) NSDictionary *source;
@property (nonatomic, weak) id<RNCWebViewDelegate> _Nullable delegate;
@property (nonatomic, copy) NSDictionary * _Nullable source;
@property (nonatomic, assign) BOOL messagingEnabled;
@property (nonatomic, copy) NSString *injectedJavaScript;
@property (nonatomic, copy) NSString * _Nullable injectedJavaScript;
@property (nonatomic, assign) BOOL scrollEnabled;
@property (nonatomic, assign) BOOL sharedCookiesEnabled;
@property (nonatomic, assign) BOOL pagingEnabled;
@ -42,20 +42,20 @@
@property (nonatomic, assign) BOOL allowsBackForwardNavigationGestures;
@property (nonatomic, assign) BOOL incognito;
@property (nonatomic, assign) BOOL useSharedProcessPool;
@property (nonatomic, copy) NSString *userAgent;
@property (nonatomic, copy) NSString *applicationNameForUserAgent;
@property (nonatomic, copy) NSString * _Nullable userAgent;
@property (nonatomic, copy) NSString * _Nullable applicationNameForUserAgent;
@property (nonatomic, assign) BOOL cacheEnabled;
@property (nonatomic, assign) BOOL javaScriptEnabled;
@property (nonatomic, assign) BOOL allowsLinkPreview;
@property (nonatomic, assign) BOOL showsHorizontalScrollIndicator;
@property (nonatomic, assign) BOOL showsVerticalScrollIndicator;
@property (nonatomic, assign) BOOL directionalLockEnabled;
@property (nonatomic, copy) NSString *allowingReadAccessToURL;
@property (nonatomic, copy) NSString * _Nullable allowingReadAccessToURL;
+ (void)setClientAuthenticationCredential:(nullable NSURLCredential*)credential;
+ (void)setCustomCertificatesForHost:(nullable NSDictionary *)certificates;
- (void)postMessage:(NSString *)message;
- (void)injectJavaScript:(NSString *)script;
- (void)postMessage:(NSString *_Nullable)message;
- (void)injectJavaScript:(NSString *_Nullable)script;
- (void)goForward;
- (void)goBack;
- (void)reload;

View File

@ -286,8 +286,8 @@ static NSDictionary* customCertificatesForHost;
} else {
_isFullScreenVideoOpen = NO;
RCTUnsafeExecuteOnMainQueueSync(^{
[RCTSharedApplication() setStatusBarHidden:_savedStatusBarHidden animated:YES];
[RCTSharedApplication() setStatusBarStyle:_savedStatusBarStyle animated:YES];
[RCTSharedApplication() setStatusBarHidden:self->_savedStatusBarHidden animated:YES];
[RCTSharedApplication() setStatusBarStyle:self->_savedStatusBarStyle animated:YES];
});
}
#pragma clang diagnostic pop
@ -741,8 +741,8 @@ static NSDictionary* customCertificatesForHost;
* topViewController
*/
-(UIViewController *)topViewController{
   UIViewController *controller = [self topViewControllerWithRootViewController:[self getCurrentWindow].rootViewController];
   return controller;
UIViewController *controller = [self topViewControllerWithRootViewController:[self getCurrentWindow].rootViewController];
return controller;
}
/**
@ -812,7 +812,7 @@ static NSDictionary* customCertificatesForHost;
if (![self.delegate webView:self
shouldStartLoadForRequest:event
withCallback:_onShouldStartLoadWithRequest]) {
decisionHandler(WKNavigationResponsePolicyCancel);
decisionHandler(WKNavigationActionPolicyCancel);
return;
}
}
@ -831,7 +831,7 @@ static NSDictionary* customCertificatesForHost;
}
// Allow all navigation by default
decisionHandler(WKNavigationResponsePolicyAllow);
decisionHandler(WKNavigationActionPolicyAllow);
}
/**
@ -918,7 +918,7 @@ static NSDictionary* customCertificatesForHost;
callback([NSString stringWithFormat:@"%@", result]);
}
if (error != nil) {
RCTLogWarn([NSString stringWithFormat:@"Error evaluating injectedJavaScript: This is possibly due to an unsupported return type. Try adding true to the end of your injectedJavaScript string. %@", error]);
RCTLogWarn(@"%@", [NSString stringWithFormat:@"Error evaluating injectedJavaScript: This is possibly due to an unsupported return type. Try adding true to the end of your injectedJavaScript string. %@", error]);
}
}];
}