Selaa lähdekoodia

fix(macOS): Don't include iOS pull-to-refresh control (#1636)

* Update RNCWebView.h

Limit methods relating to pull to refresh to only iOS

* Update RNCWebView.m

Block methods relating to pull to refresh when the target is macOS as macOS does not have the UIRefreshControl

Co-authored-by: Eloy Durán <eloy.de.enige@gmail.com>
Brandon Lax 3 vuotta sitten
vanhempi
commit
dbf46593fa
No account linked to committer's email address
2 muutettua tiedostoa jossa 6 lisäystä ja 2 poistoa
  1. 4
    0
      apple/RNCWebView.h
  2. 2
    2
      apple/RNCWebView.m

+ 4
- 0
apple/RNCWebView.h Näytä tiedosto

64
 @property (nonatomic, assign) BOOL ignoreSilentHardwareSwitch;
64
 @property (nonatomic, assign) BOOL ignoreSilentHardwareSwitch;
65
 @property (nonatomic, copy) NSString * _Nullable allowingReadAccessToURL;
65
 @property (nonatomic, copy) NSString * _Nullable allowingReadAccessToURL;
66
 @property (nonatomic, assign) BOOL pullToRefreshEnabled;
66
 @property (nonatomic, assign) BOOL pullToRefreshEnabled;
67
+#if !TARGET_OS_OSX
67
 @property (nonatomic, weak) UIRefreshControl * refreshControl;
68
 @property (nonatomic, weak) UIRefreshControl * refreshControl;
69
+#endif
68
 
70
 
69
 #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* iOS 13 */
71
 #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* iOS 13 */
70
 @property (nonatomic, assign) WKContentMode contentMode;
72
 @property (nonatomic, assign) WKContentMode contentMode;
78
 - (void)goBack;
80
 - (void)goBack;
79
 - (void)reload;
81
 - (void)reload;
80
 - (void)stopLoading;
82
 - (void)stopLoading;
83
+#if !TARGET_OS_OSX
81
 - (void)addPullToRefreshControl;
84
 - (void)addPullToRefreshControl;
82
 - (void)pullToRefresh:(UIRefreshControl *)refreshControl;
85
 - (void)pullToRefresh:(UIRefreshControl *)refreshControl;
86
+#endif
83
 
87
 
84
 @end
88
 @end

+ 2
- 2
apple/RNCWebView.m Näytä tiedosto

1136
     [_webView reload];
1136
     [_webView reload];
1137
   }
1137
   }
1138
 }
1138
 }
1139
-
1139
+#if !TARGET_OS_OSX
1140
 - (void)addPullToRefreshControl
1140
 - (void)addPullToRefreshControl
1141
 {
1141
 {
1142
     UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
1142
     UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
1151
     [refreshControl endRefreshing];
1151
     [refreshControl endRefreshing];
1152
 }
1152
 }
1153
 
1153
 
1154
-#if !TARGET_OS_OSX
1154
+
1155
 - (void)setPullToRefreshEnabled:(BOOL)pullToRefreshEnabled
1155
 - (void)setPullToRefreshEnabled:(BOOL)pullToRefreshEnabled
1156
 {
1156
 {
1157
     _pullToRefreshEnabled = pullToRefreshEnabled;
1157
     _pullToRefreshEnabled = pullToRefreshEnabled;