fix(ios): Add missing nullability specifiers; fix if block warning (#1898)

This commit is contained in:
Andrew Goodale
2021-03-17 00:23:46 +01:00
committed by GitHub
parent 4c71ff2d93
commit 85dfca894f
2 changed files with 9 additions and 5 deletions
+7 -4
View File
@@ -20,8 +20,11 @@
@end
@interface RNCWeakScriptMessageDelegate : NSObject<WKScriptMessageHandler>
@property (nonatomic, weak) id<WKScriptMessageHandler> scriptDelegate;
- (instancetype)initWithDelegate:(id<WKScriptMessageHandler>)scriptDelegate;
@property (nonatomic, weak, nullable) id<WKScriptMessageHandler> scriptDelegate;
- (nullable instancetype)initWithDelegate:(id<WKScriptMessageHandler> _Nullable)scriptDelegate;
@end
@interface RNCWebView : RCTView
@@ -66,7 +69,7 @@
@property (nonatomic, copy) NSString * _Nullable allowingReadAccessToURL;
@property (nonatomic, assign) BOOL pullToRefreshEnabled;
#if !TARGET_OS_OSX
@property (nonatomic, weak) UIRefreshControl * refreshControl;
@property (nonatomic, weak) UIRefreshControl * _Nullable refreshControl;
#endif
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* iOS 13 */
@@ -83,7 +86,7 @@
- (void)stopLoading;
#if !TARGET_OS_OSX
- (void)addPullToRefreshControl;
- (void)pullToRefresh:(UIRefreshControl *)refreshControl;
- (void)pullToRefresh:(UIRefreshControl *_Nonnull)refreshControl;
#endif
@end
+2 -1
View File
@@ -1064,7 +1064,8 @@ static NSDictionary* customCertificatesForHost;
return;
}
if ([error.domain isEqualToString:@"WebKitErrorDomain"] && error.code == 102 || [error.domain isEqualToString:@"WebKitErrorDomain"] && error.code == 101) {
if ([error.domain isEqualToString:@"WebKitErrorDomain"] &&
(error.code == 102 || error.code == 101)) {
// Error code 102 "Frame load interrupted" is raised by the WKWebView
// when the URL is from an http redirect. This is a common pattern when
// implementing OAuth with a WebView.