浏览代码

Updated react-native-macos version. ifdef'd out UIScrollViewDelegate methods for mac. Added an assert clause.

Tom Underhill 5 年前
父节点
当前提交
8be7a855af
共有 3 个文件被更改,包括 10 次插入13 次删除
  1. 5
    8
      ios/RNCWebView.m
  2. 1
    1
      package.json
  3. 4
    4
      yarn.lock

+ 5
- 8
ios/RNCWebView.m 查看文件

52
 @implementation RNCWKWebView
52
 @implementation RNCWKWebView
53
 - (void)scrollWheel:(NSEvent *)theEvent {
53
 - (void)scrollWheel:(NSEvent *)theEvent {
54
   RNCWebView *rncWebView = (RNCWebView *)[self superview];
54
   RNCWebView *rncWebView = (RNCWebView *)[self superview];
55
+  RCTAssert([rncWebView isKindOfClass:[rncWebView class]], @"superview must be an RNCWebView");
55
   if (![rncWebView scrollEnabled]) {
56
   if (![rncWebView scrollEnabled]) {
56
     [[self nextResponder] scrollWheel:theEvent];
57
     [[self nextResponder] scrollWheel:theEvent];
57
     return;
58
     return;
713
 #endif // !TARGET_OS_OSX
714
 #endif // !TARGET_OS_OSX
714
 
715
 
715
 #if !TARGET_OS_OSX
716
 #if !TARGET_OS_OSX
717
+// UIScrollViewDelegate method
716
 - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
718
 - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
717
-#else
718
-- (void)scrollViewWillBeginDragging:(RCTUIScrollView *)scrollView
719
-#endif // !TARGET_OS_OSX
720
 {
719
 {
721
-#if !TARGET_OS_OSX
722
   scrollView.decelerationRate = _decelerationRate;
720
   scrollView.decelerationRate = _decelerationRate;
723
-#endif // !TARGET_OS_OSX
724
 }
721
 }
722
+#endif // !TARGET_OS_OSX
725
 
723
 
726
 - (void)setScrollEnabled:(BOOL)scrollEnabled
724
 - (void)setScrollEnabled:(BOOL)scrollEnabled
727
 {
725
 {
732
 }
730
 }
733
 
731
 
734
 #if !TARGET_OS_OSX
732
 #if !TARGET_OS_OSX
733
+// UIScrollViewDelegate method
735
 - (void)scrollViewDidScroll:(UIScrollView *)scrollView
734
 - (void)scrollViewDidScroll:(UIScrollView *)scrollView
736
-#else
737
-- (void)scrollViewDidScroll:(RCTUIScrollView *)scrollView
738
-#endif // !TARGET_OS_OSX
739
 {
735
 {
740
   // Don't allow scrolling the scrollView.
736
   // Don't allow scrolling the scrollView.
741
   if (!_scrollEnabled) {
737
   if (!_scrollEnabled) {
766
     _onScroll(event);
762
     _onScroll(event);
767
   }
763
   }
768
 }
764
 }
765
+#endif // !TARGET_OS_OSX
769
 
766
 
770
 - (void)setDirectionalLockEnabled:(BOOL)directionalLockEnabled
767
 - (void)setDirectionalLockEnabled:(BOOL)directionalLockEnabled
771
 {
768
 {

+ 1
- 1
package.json 查看文件

60
     "metro-react-native-babel-preset": "0.54.1",
60
     "metro-react-native-babel-preset": "0.54.1",
61
     "react": "16.9.0",
61
     "react": "16.9.0",
62
     "react-native": "0.61.5",
62
     "react-native": "0.61.5",
63
-    "react-native-macos": "0.60.0-microsoft.44",
63
+    "react-native-macos": "0.60.0-microsoft.49",
64
     "semantic-release": "15.13.24",
64
     "semantic-release": "15.13.24",
65
     "typescript": "3.6.2"
65
     "typescript": "3.6.2"
66
   },
66
   },

+ 4
- 4
yarn.lock 查看文件

7907
   resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.9.0.tgz#21ca9561399aad0ff1a7701c01683e8ca981edcb"
7907
   resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.9.0.tgz#21ca9561399aad0ff1a7701c01683e8ca981edcb"
7908
   integrity sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw==
7908
   integrity sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw==
7909
 
7909
 
7910
-react-native-macos@0.60.0-microsoft.44:
7911
-  version "0.60.0-microsoft.44"
7912
-  resolved "https://registry.yarnpkg.com/react-native-macos/-/react-native-macos-0.60.0-microsoft.44.tgz#5d3e3edff7e282ea71526c1e167ca57d80ec9aff"
7913
-  integrity sha512-QMb2cMyKAmAg+k2Io7af7SeOne9d1oUnl5Agbjy7YQe6/xmKl3qx0tM+mBvDJPZk204aqhmkvQJY8zpoVOyNsA==
7910
+react-native-macos@0.60.0-microsoft.49:
7911
+  version "0.60.0-microsoft.49"
7912
+  resolved "https://registry.yarnpkg.com/react-native-macos/-/react-native-macos-0.60.0-microsoft.49.tgz#ac506343f7450f12f852769102e6262b531b181f"
7913
+  integrity sha512-2631KIggGpw1RoLC/lWRZ/agFgAAMWuoQrRcmGsN+0neXHggEY5jUzz1uV6LeqKkrcudV+qaz3ajo85UjwqDIA==
7914
   dependencies:
7914
   dependencies:
7915
     "@babel/runtime" "^7.0.0"
7915
     "@babel/runtime" "^7.0.0"
7916
     "@react-native-community/cli" "^2.6.0"
7916
     "@react-native-community/cli" "^2.6.0"