Browse Source

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

Tom Underhill 4 years ago
parent
commit
8be7a855af
3 changed files with 10 additions and 13 deletions
  1. 5
    8
      ios/RNCWebView.m
  2. 1
    1
      package.json
  3. 4
    4
      yarn.lock

+ 5
- 8
ios/RNCWebView.m View File

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

+ 1
- 1
package.json View File

@@ -60,7 +60,7 @@
60 60
     "metro-react-native-babel-preset": "0.54.1",
61 61
     "react": "16.9.0",
62 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 64
     "semantic-release": "15.13.24",
65 65
     "typescript": "3.6.2"
66 66
   },

+ 4
- 4
yarn.lock View File

@@ -7907,10 +7907,10 @@ react-is@^16.8.1, react-is@^16.8.4:
7907 7907
   resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.9.0.tgz#21ca9561399aad0ff1a7701c01683e8ca981edcb"
7908 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 7914
   dependencies:
7915 7915
     "@babel/runtime" "^7.0.0"
7916 7916
     "@react-native-community/cli" "^2.6.0"