From 3f876c7a0cc5e1429b659a5cfb0c048966073778 Mon Sep 17 00:00:00 2001 From: Shawn Dempsey Date: Fri, 9 Dec 2022 16:25:48 -0800 Subject: [PATCH 1/4] [Fabric] Shim RCTEnhancedScrollView --- .../ScrollView/RCTEnhancedScrollView.h | 2 + .../ScrollView/RCTEnhancedScrollView.mm | 22 +++++++- .../RCTPullToRefreshViewComponentView.mm | 16 ++++++ .../ScrollView/RCTScrollViewComponentView.h | 2 + .../ScrollView/RCTScrollViewComponentView.mm | 52 ++++++++++++++++--- 5 files changed, 86 insertions(+), 8 deletions(-) diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h index 7bd19f69537162..e5a5fe1ec68a7a 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h @@ -40,7 +40,9 @@ NS_ASSUME_NONNULL_BEGIN * resilient to other code as possible: even if something else nil the delegate, other delegates that were subscribed * via the splitter will continue working. */ +#if !TARGET_OS_OSX // [TODO(macOS GH#774) @property (nonatomic, strong, readonly) RCTGenericDelegateSplitter> *delegateSplitter; +#endif // ]TODO(macOS GH#774) @property (nonatomic, weak) id overridingDelegate; @property (nonatomic, assign) BOOL pinchGestureEnabled; diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm index 02d5f4af0cd1f4..178f620091fc65 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm @@ -7,12 +7,24 @@ #import "RCTEnhancedScrollView.h" #import - -@interface RCTEnhancedScrollView () +#import +#import + +@interface RCTEnhancedScrollView () < +#if !TARGET_OS_OSX // [TODO(macOS GH#774) + UIScrollViewDelegate +#else + RCTScrollableProtocol, RCTAutoInsetsProtocol +#endif +> // ]TODO(macOS GH#774) @end @implementation RCTEnhancedScrollView { +#if !TARGET_OS_OSX // [TODO(macOS GH#774) __weak id _publicDelegate; +#else + __weak id _publicDelegate; +#endif // ]TODO(macOS GH#774) BOOL _isSetContentOffsetDisabled; } @@ -30,6 +42,8 @@ + (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { + // TODO - Fabric: Enable Delegate Splitter +#if !TARGET_OS_OSX // [TODO(macOS GH#774) // We set the default behavior to "never" so that iOS // doesn't do weird things to UIScrollView insets automatically // and keeps it as an opt-in behavior. @@ -45,6 +59,7 @@ - (instancetype)initWithFrame:(CGRect)frame [weakSelf setPrivateDelegate:delegate]; }]; [_delegateSplitter addDelegate:self]; +#endif // ]TODO(macOS GH#774) } return self; @@ -88,6 +103,7 @@ - (void)setContentOffset:(CGPoint)contentOffset RCTSanitizeNaNValue(contentOffset.y, @"scrollView.contentOffset.y")); } +#if !TARGET_OS_OSX // [TODO(macOS GH#774) - (BOOL)touchesShouldCancelInContentView:(RCTUIView *)view // TODO(macOS GH#774) { if ([_overridingDelegate respondsToSelector:@selector(touchesShouldCancelInContentView:)]) { @@ -128,6 +144,8 @@ - (void)setDelegate:(id)delegate } } +#endif // ]TODO(macOS GH#774) + #pragma mark - UIScrollViewDelegate - (void)scrollViewWillEndDragging:(RCTUIScrollView *)scrollView diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm index b897d8a8e8b0c8..88f3ca6662c1ef 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm @@ -24,7 +24,9 @@ @interface RCTPullToRefreshViewComponentView () (); _props = defaultProps; +#if !TARGET_OS_OSX // [TODO(macOS GH#774) _refreshControl = [UIRefreshControl new]; [_refreshControl addTarget:self action:@selector(handleUIControlEventValueChanged) forControlEvents:UIControlEventValueChanged]; +#endif // ]TODO(macOS GH#774) } return self; @@ -61,11 +65,13 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & auto const &newConcreteProps = *std::static_pointer_cast(props); if (newConcreteProps.refreshing != oldConcreteProps.refreshing) { +#if !TARGET_OS_OSX // [TODO(macOS GH#774) if (newConcreteProps.refreshing) { [_refreshControl beginRefreshing]; } else { [_refreshControl endRefreshing]; } +#endif // ]TODO(macOS GH#774) } BOOL needsUpdateTitle = NO; @@ -97,7 +103,9 @@ - (void)_updateTitle auto const &concreteProps = *std::static_pointer_cast(_props); if (concreteProps.title.empty()) { +#if !TARGET_OS_OSX // [TODO(macOS GH#774) _refreshControl.attributedTitle = nil; +#endif // ]TODO(macOS GH#774) return; } @@ -106,8 +114,10 @@ - (void)_updateTitle attributes[NSForegroundColorAttributeName] = RCTUIColorFromSharedColor(concreteProps.titleColor); } +#if !TARGET_OS_OSX // [TODO(macOS GH#774) _refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:RCTNSStringFromString(concreteProps.title) attributes:attributes]; +#endif // ]TODO(macOS GH#774) } #pragma mark - Attaching & Detaching @@ -132,9 +142,11 @@ - (void)_attach return; } +#if !TARGET_OS_OSX // [TODO(macOS GH#774) if (@available(macOS 13.0, *)) { _scrollViewComponentView.scrollView.refreshControl = _refreshControl; } +#endif // ]TODO(macOS GH#774) } - (void)_detach @@ -144,11 +156,13 @@ - (void)_detach } // iOS requires to end refreshing before unmounting. +#if !TARGET_OS_OSX // [TODO(macOS GH#774) [_refreshControl endRefreshing]; if (@available(macOS 13.0, *)) { _scrollViewComponentView.scrollView.refreshControl = nil; } +#endif // ]TODO(macOS GH#774) _scrollViewComponentView = nil; } @@ -161,11 +175,13 @@ - (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args - (void)setNativeRefreshing:(BOOL)refreshing { +#if !TARGET_OS_OSX // [TODO(macOS GH#774) if (refreshing) { [_refreshControl beginRefreshing]; } else { [_refreshControl endRefreshing]; } +#endif // ]TODO(macOS GH#774) } #pragma mark - RCTRefreshableProtocol diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h index 33651572822461..579a7d950fa621 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h @@ -45,8 +45,10 @@ NS_ASSUME_NONNULL_BEGIN /* * Returns a delegate splitter that can be used to subscribe for UIScrollView delegate. */ +#if !TARGET_OS_OSX // TODO(macOS GH#774) @property (nonatomic, strong, readonly) RCTGenericDelegateSplitter> *scrollViewDelegateSplitter; +#endif @end diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm index 4c28bbef2c9cbb..cad3ff3207ed6a 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm @@ -28,6 +28,7 @@ static CGFloat const kClippingLeeway = 44.0; +#if !TARGET_OS_OSX // [TODO(macOS GH#774) static UIScrollViewKeyboardDismissMode RCTUIKeyboardDismissModeFromProps(ScrollViewProps const &props) { switch (props.keyboardDismissMode) { @@ -78,9 +79,12 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(RCTUIScrollView *sc userInfo:userInfo]; } } +#endif // ]TODO(macOS GH#774) @interface RCTScrollViewComponentView () < +#if !TARGET_OS_OSX // [TODO(macOS GH#774) UIScrollViewDelegate, +#endif // ]TODO(macOS GH#774) RCTScrollViewProtocol, RCTScrollableProtocol, RCTEnhancedScrollViewOverridingDelegate> @@ -105,7 +109,7 @@ @implementation RCTScrollViewComponentView { + (RCTScrollViewComponentView *_Nullable)findScrollViewComponentViewForView:(RCTUIView *)view // TODO(macOS GH#774) { do { - view = view.superview; + view = (RCTUIView *)view.superview; } while (view != nil && ![view isKindOfClass:[RCTScrollViewComponentView class]]); return (RCTScrollViewComponentView *)view; } @@ -118,7 +122,9 @@ - (instancetype)initWithFrame:(CGRect)frame _scrollView = [[RCTEnhancedScrollView alloc] initWithFrame:self.bounds]; _scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; +#if !TARGET_OS_OSX // [TODO(macOS GH#774) _scrollView.delaysContentTouches = NO; +#endif // ]TODO(macOS GH#774) ((RCTEnhancedScrollView *)_scrollView).overridingDelegate = self; _isUserTriggeredScrolling = NO; _shouldUpdateContentInsetAdjustmentBehavior = YES; @@ -126,8 +132,9 @@ - (instancetype)initWithFrame:(CGRect)frame _containerView = [[RCTUIView alloc] initWithFrame:CGRectZero]; // TODO(macOS GH#774) [_scrollView addSubview:_containerView]; - +#if !TARGET_OS_OSX // [TODO(macOS GH#774) [self.scrollViewDelegateSplitter addDelegate:self]; +#endif // ]TODO(macOS GH#774) _scrollEventThrottle = INFINITY; } @@ -139,13 +146,17 @@ - (void)dealloc { // Removing all delegates from the splitter nils the actual delegate which prevents a crash on UIScrollView // deallocation. +#if !TARGET_OS_OSX // [TODO(macOS GH#774) [self.scrollViewDelegateSplitter removeAllDelegates]; +#endif // ]TODO(macOS GH#774) } +#if !TARGET_OS_OSX // [TODO(macOS GH#774) - (RCTGenericDelegateSplitter> *)scrollViewDelegateSplitter { return ((RCTEnhancedScrollView *)_scrollView).delegateSplitter; } +#endif // ]TODO(macOS GH#774) #pragma mark - RCTMountingTransactionObserving @@ -172,7 +183,9 @@ - (void)updateLayoutMetrics:(const LayoutMetrics &)layoutMetrics : CGAffineTransformMakeScale(-1, 1); _containerView.transform = transform; +#if !TARGET_OS_OSX // [TODO(macOS GH#774) _scrollView.transform = transform; +#endif // ]TODO(macOS GH#774) } } @@ -195,19 +208,25 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & // FIXME: Commented props are not supported yet. MAP_SCROLL_VIEW_PROP(alwaysBounceHorizontal); MAP_SCROLL_VIEW_PROP(alwaysBounceVertical); +#if !TARGET_OS_OSX // [TODO(macOS GH#774) MAP_SCROLL_VIEW_PROP(bounces); MAP_SCROLL_VIEW_PROP(bouncesZoom); MAP_SCROLL_VIEW_PROP(canCancelContentTouches); +#endif // ]TODO(macOS GH#774) MAP_SCROLL_VIEW_PROP(centerContent); // MAP_SCROLL_VIEW_PROP(automaticallyAdjustContentInsets); +#if !TARGET_OS_OSX // [TODO(macOS GH#774) MAP_SCROLL_VIEW_PROP(decelerationRate); MAP_SCROLL_VIEW_PROP(directionalLockEnabled); MAP_SCROLL_VIEW_PROP(maximumZoomScale); MAP_SCROLL_VIEW_PROP(minimumZoomScale); +#endif // ]TODO(macOS GH#774) MAP_SCROLL_VIEW_PROP(scrollEnabled); +#if !TARGET_OS_OSX // [TODO(macOS GH#774) MAP_SCROLL_VIEW_PROP(pagingEnabled); MAP_SCROLL_VIEW_PROP(pinchGestureEnabled); MAP_SCROLL_VIEW_PROP(scrollsToTop); +#endif // ]TODO(macOS GH#774) MAP_SCROLL_VIEW_PROP(showsHorizontalScrollIndicator); MAP_SCROLL_VIEW_PROP(showsVerticalScrollIndicator); @@ -216,7 +235,9 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & } if (oldScrollViewProps.indicatorStyle != newScrollViewProps.indicatorStyle) { +#if !TARGET_OS_OSX // [TODO(macOS GH#774) _scrollView.indicatorStyle = RCTUIScrollViewIndicatorStyleFromProps(newScrollViewProps); +#endif // ]TODO(macOS GH#774) } if (oldScrollViewProps.scrollEventThrottle != newScrollViewProps.scrollEventThrottle) { @@ -260,6 +281,7 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & scrollView.snapToOffsets = snapToOffsets; } +#if !TARGET_OS_OSX // TODO(macOS GH#774) if (@available(iOS 13.0, *)) { if (oldScrollViewProps.automaticallyAdjustsScrollIndicatorInsets != newScrollViewProps.automaticallyAdjustsScrollIndicatorInsets) { @@ -282,12 +304,15 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & } _shouldUpdateContentInsetAdjustmentBehavior = NO; } - +#endif + MAP_SCROLL_VIEW_PROP(disableIntervalMomentum); MAP_SCROLL_VIEW_PROP(snapToInterval); if (oldScrollViewProps.keyboardDismissMode != newScrollViewProps.keyboardDismissMode) { +#if !TARGET_OS_OSX // TODO(macOS GH#774) scrollView.keyboardDismissMode = RCTUIKeyboardDismissModeFromProps(newScrollViewProps); +#endif } [super updateProps:props oldProps:oldProps]; @@ -350,7 +375,7 @@ - (void)unmountChildComponentView:(RCTUIView *)childCo */ - (BOOL)_shouldDisableScrollInteraction { - RCTUIView *ancestorView = self.superview; // TODO(macOS GH#774) + RCTUIView *ancestorView = (RCTUIView *)self.superview; // TODO(macOS GH#774) while (ancestorView) { if ([ancestorView respondsToSelector:@selector(isJSResponder)]) { @@ -360,7 +385,7 @@ - (BOOL)_shouldDisableScrollInteraction } } - ancestorView = ancestorView.superview; + ancestorView = (RCTUIView *)ancestorView.superview; } return NO; @@ -397,7 +422,9 @@ - (void)prepareForRecycle // We set the default behavior to "never" so that iOS // doesn't do weird things to UIScrollView insets automatically // and keeps it as an opt-in behavior. +#if !TARGET_OS_OSX // [TODO(macOS GH#774) _scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; +#endif // ]TODO(macOS GH#774) _shouldUpdateContentInsetAdjustmentBehavior = YES; _state.reset(); _isUserTriggeredScrolling = NO; @@ -428,8 +455,11 @@ - (void)scrollViewDidScroll:(RCTUIScrollView *)scrollView // TODO(macOS GH#774) if (_eventEmitter) { std::static_pointer_cast(_eventEmitter)->onScroll([self _scrollViewMetrics]); } - + // Once Fabric implements proper NativeAnimationDriver, this should be removed. + // This is just a workaround to allow animations based on onScroll event. +#if !TARGET_OS_OSX // TODO(macOS GH#774) RCTSendScrollEventForNativeAnimations_DEPRECATED(scrollView, self.tag); +#endif } [self _remountChildrenIfNeeded]; @@ -563,7 +593,9 @@ - (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args - (void)flashScrollIndicators { +#if !TARGET_OS_OSX // TODO(macOS GH#774) [_scrollView flashScrollIndicators]; +#endif } - (void)scrollTo:(double)x y:(double)y animated:(BOOL)animated @@ -631,8 +663,10 @@ - (void)_remountChildrenIfNeeded - (void)_remountChildren { +#if !TARGET_OS_OSX // TODO(macOS GH#774) [_scrollView updateClippedSubviewsWithClipRect:CGRectInset(_scrollView.bounds, -kClippingLeeway, -kClippingLeeway) relativeToView:_scrollView]; +#endif } #pragma mark - RCTScrollableProtocol @@ -660,7 +694,9 @@ - (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated offset.x = self.contentSize.width - _scrollView.frame.size.width - offset.x; } +#if !TARGET_OS_OSX // TODO(macOS GH#774) [_scrollView setContentOffset:offset animated:animated]; +#endif if (!animated) { // When not animated, the expected workflow in ``scrollViewDidEndScrollingAnimation`` after scrolling is not going @@ -671,9 +707,12 @@ - (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated - (void)zoomToRect:(CGRect)rect animated:(BOOL)animated { +#if !TARGET_OS_OSX // TODO(macOS GH#774) [_scrollView zoomToRect:rect animated:animated]; +#endif } +#if !TARGET_OS_OSX // TODO(macOS GH#774) - (void)addScrollListener:(NSObject *)scrollListener { [self.scrollViewDelegateSplitter addDelegate:scrollListener]; @@ -683,6 +722,7 @@ - (void)removeScrollListener:(NSObject *)scrollListener { [self.scrollViewDelegateSplitter removeDelegate:scrollListener]; } +#endif @end From b627a167c5e0f523eb52898bfeaa7856d9d82fc7 Mon Sep 17 00:00:00 2001 From: Shawn Dempsey Date: Wed, 21 Dec 2022 17:03:10 -0800 Subject: [PATCH 2/4] Fix missing tags --- React/Base/macOS/RCTUIKit.m | 2 +- .../ScrollView/RCTEnhancedScrollView.mm | 1 - .../ScrollView/RCTScrollViewComponentView.h | 4 +-- .../ScrollView/RCTScrollViewComponentView.mm | 32 +++++++++---------- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/React/Base/macOS/RCTUIKit.m b/React/Base/macOS/RCTUIKit.m index 1729ec896febc6..c5c5f2feb32042 100644 --- a/React/Base/macOS/RCTUIKit.m +++ b/React/Base/macOS/RCTUIKit.m @@ -608,7 +608,7 @@ - (instancetype)initWithFrame:(NSRect)frameRect return self; } -@end // ]TODO(macOS GH#774) +@end // ]TODO(macOS GH#774) @implementation RCTUISwitch diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm index 178f620091fc65..9f6f23e7a80d07 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm @@ -42,7 +42,6 @@ + (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { - // TODO - Fabric: Enable Delegate Splitter #if !TARGET_OS_OSX // [TODO(macOS GH#774) // We set the default behavior to "never" so that iOS // doesn't do weird things to UIScrollView insets automatically diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h index 579a7d950fa621..0c15e2f9160d99 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h @@ -45,10 +45,10 @@ NS_ASSUME_NONNULL_BEGIN /* * Returns a delegate splitter that can be used to subscribe for UIScrollView delegate. */ -#if !TARGET_OS_OSX // TODO(macOS GH#774) +#if !TARGET_OS_OSX // [TODO(macOS GH#774) @property (nonatomic, strong, readonly) RCTGenericDelegateSplitter> *scrollViewDelegateSplitter; -#endif +#endif // ]TODO(macOS GH#774) @end diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm index cad3ff3207ed6a..a13fa9570232f7 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm @@ -109,7 +109,7 @@ @implementation RCTScrollViewComponentView { + (RCTScrollViewComponentView *_Nullable)findScrollViewComponentViewForView:(RCTUIView *)view // TODO(macOS GH#774) { do { - view = (RCTUIView *)view.superview; + view = (RCTUIView *)view.superview; // TODO(macOS GH#774) } while (view != nil && ![view isKindOfClass:[RCTScrollViewComponentView class]]); return (RCTScrollViewComponentView *)view; } @@ -281,7 +281,7 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & scrollView.snapToOffsets = snapToOffsets; } -#if !TARGET_OS_OSX // TODO(macOS GH#774) +#if !TARGET_OS_OSX // [TODO(macOS GH#774) if (@available(iOS 13.0, *)) { if (oldScrollViewProps.automaticallyAdjustsScrollIndicatorInsets != newScrollViewProps.automaticallyAdjustsScrollIndicatorInsets) { @@ -304,15 +304,15 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & } _shouldUpdateContentInsetAdjustmentBehavior = NO; } -#endif +#endif // ]TODO(macOS GH#774) MAP_SCROLL_VIEW_PROP(disableIntervalMomentum); MAP_SCROLL_VIEW_PROP(snapToInterval); if (oldScrollViewProps.keyboardDismissMode != newScrollViewProps.keyboardDismissMode) { -#if !TARGET_OS_OSX // TODO(macOS GH#774) +#if !TARGET_OS_OSX // [TODO(macOS GH#774) scrollView.keyboardDismissMode = RCTUIKeyboardDismissModeFromProps(newScrollViewProps); -#endif +#endif // ]TODO(macOS GH#774) } [super updateProps:props oldProps:oldProps]; @@ -455,11 +455,9 @@ - (void)scrollViewDidScroll:(RCTUIScrollView *)scrollView // TODO(macOS GH#774) if (_eventEmitter) { std::static_pointer_cast(_eventEmitter)->onScroll([self _scrollViewMetrics]); } - // Once Fabric implements proper NativeAnimationDriver, this should be removed. - // This is just a workaround to allow animations based on onScroll event. -#if !TARGET_OS_OSX // TODO(macOS GH#774) +#if !TARGET_OS_OSX // [TODO(macOS GH#774) RCTSendScrollEventForNativeAnimations_DEPRECATED(scrollView, self.tag); -#endif +#endif // ]TODO(macOS GH#774) } [self _remountChildrenIfNeeded]; @@ -593,9 +591,9 @@ - (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args - (void)flashScrollIndicators { -#if !TARGET_OS_OSX // TODO(macOS GH#774) +#if !TARGET_OS_OSX // ]TODO(macOS GH#774) [_scrollView flashScrollIndicators]; -#endif +#endif // ]TODO(macOS GH#774) } - (void)scrollTo:(double)x y:(double)y animated:(BOOL)animated @@ -663,10 +661,10 @@ - (void)_remountChildrenIfNeeded - (void)_remountChildren { -#if !TARGET_OS_OSX // TODO(macOS GH#774) +#if !TARGET_OS_OSX // [TODO(macOS GH#774) [_scrollView updateClippedSubviewsWithClipRect:CGRectInset(_scrollView.bounds, -kClippingLeeway, -kClippingLeeway) relativeToView:_scrollView]; -#endif +#endif // ]TODO(macOS GH#774) } #pragma mark - RCTScrollableProtocol @@ -694,9 +692,9 @@ - (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated offset.x = self.contentSize.width - _scrollView.frame.size.width - offset.x; } -#if !TARGET_OS_OSX // TODO(macOS GH#774) +#if !TARGET_OS_OSX // ]TODO(macOS GH#774) [_scrollView setContentOffset:offset animated:animated]; -#endif +#endif // ]TODO(macOS GH#774) if (!animated) { // When not animated, the expected workflow in ``scrollViewDidEndScrollingAnimation`` after scrolling is not going @@ -712,7 +710,7 @@ - (void)zoomToRect:(CGRect)rect animated:(BOOL)animated #endif } -#if !TARGET_OS_OSX // TODO(macOS GH#774) +#if !TARGET_OS_OSX // [TODO(macOS GH#774) - (void)addScrollListener:(NSObject *)scrollListener { [self.scrollViewDelegateSplitter addDelegate:scrollListener]; @@ -722,7 +720,7 @@ - (void)removeScrollListener:(NSObject *)scrollListener { [self.scrollViewDelegateSplitter removeDelegate:scrollListener]; } -#endif +#endif // ]TODO(macOS GH#774) @end From a9047ae824a4e74c8f98071d20dd44686bdf4293 Mon Sep 17 00:00:00 2001 From: Shawn Dempsey Date: Wed, 21 Dec 2022 17:06:04 -0800 Subject: [PATCH 3/4] Fix bad tag --- .../ComponentViews/ScrollView/RCTScrollViewComponentView.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm index a13fa9570232f7..58a4c490a8ac2b 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm @@ -692,9 +692,9 @@ - (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated offset.x = self.contentSize.width - _scrollView.frame.size.width - offset.x; } -#if !TARGET_OS_OSX // ]TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) [_scrollView setContentOffset:offset animated:animated]; -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) if (!animated) { // When not animated, the expected workflow in ``scrollViewDidEndScrollingAnimation`` after scrolling is not going @@ -707,7 +707,7 @@ - (void)zoomToRect:(CGRect)rect animated:(BOOL)animated { #if !TARGET_OS_OSX // TODO(macOS GH#774) [_scrollView zoomToRect:rect animated:animated]; -#endif +#endif // TODO(macOS GH#774) } #if !TARGET_OS_OSX // [TODO(macOS GH#774) From ee950629bb1ec66129f5fea6843caaee70f95843 Mon Sep 17 00:00:00 2001 From: Shawn Dempsey Date: Wed, 21 Dec 2022 17:29:26 -0800 Subject: [PATCH 4/4] Remove brackets from iOS specific tags --- .../ScrollView/RCTEnhancedScrollView.h | 4 +- .../ScrollView/RCTEnhancedScrollView.mm | 20 +++--- .../RCTPullToRefreshViewComponentView.mm | 32 ++++----- .../ScrollView/RCTScrollViewComponentView.h | 4 +- .../ScrollView/RCTScrollViewComponentView.mm | 72 +++++++++---------- 5 files changed, 66 insertions(+), 66 deletions(-) diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h index e5a5fe1ec68a7a..94e652b30ca0cf 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h @@ -40,9 +40,9 @@ NS_ASSUME_NONNULL_BEGIN * resilient to other code as possible: even if something else nil the delegate, other delegates that were subscribed * via the splitter will continue working. */ -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) @property (nonatomic, strong, readonly) RCTGenericDelegateSplitter> *delegateSplitter; -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) @property (nonatomic, weak) id overridingDelegate; @property (nonatomic, assign) BOOL pinchGestureEnabled; diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm index 9f6f23e7a80d07..61616d97e38c88 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm @@ -11,18 +11,18 @@ #import @interface RCTEnhancedScrollView () < -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) UIScrollViewDelegate -#else +#else // [TODO(macOS GH#774) RCTScrollableProtocol, RCTAutoInsetsProtocol -#endif -> // ]TODO(macOS GH#774) +#endif // ]TODO(macOS GH#774) +> @end @implementation RCTEnhancedScrollView { -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) __weak id _publicDelegate; -#else +#else // [TODO(macOS GH#774) __weak id _publicDelegate; #endif // ]TODO(macOS GH#774) BOOL _isSetContentOffsetDisabled; @@ -42,7 +42,7 @@ + (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) // We set the default behavior to "never" so that iOS // doesn't do weird things to UIScrollView insets automatically // and keeps it as an opt-in behavior. @@ -58,7 +58,7 @@ - (instancetype)initWithFrame:(CGRect)frame [weakSelf setPrivateDelegate:delegate]; }]; [_delegateSplitter addDelegate:self]; -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) } return self; @@ -102,7 +102,7 @@ - (void)setContentOffset:(CGPoint)contentOffset RCTSanitizeNaNValue(contentOffset.y, @"scrollView.contentOffset.y")); } -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) - (BOOL)touchesShouldCancelInContentView:(RCTUIView *)view // TODO(macOS GH#774) { if ([_overridingDelegate respondsToSelector:@selector(touchesShouldCancelInContentView:)]) { @@ -143,7 +143,7 @@ - (void)setDelegate:(id)delegate } } -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) #pragma mark - UIScrollViewDelegate diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm index 88f3ca6662c1ef..21c8dce7adcb6d 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm @@ -24,9 +24,9 @@ @interface RCTPullToRefreshViewComponentView () (); _props = defaultProps; -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) _refreshControl = [UIRefreshControl new]; [_refreshControl addTarget:self action:@selector(handleUIControlEventValueChanged) forControlEvents:UIControlEventValueChanged]; -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) } return self; @@ -65,13 +65,13 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & auto const &newConcreteProps = *std::static_pointer_cast(props); if (newConcreteProps.refreshing != oldConcreteProps.refreshing) { -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) if (newConcreteProps.refreshing) { [_refreshControl beginRefreshing]; } else { [_refreshControl endRefreshing]; } -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) } BOOL needsUpdateTitle = NO; @@ -103,9 +103,9 @@ - (void)_updateTitle auto const &concreteProps = *std::static_pointer_cast(_props); if (concreteProps.title.empty()) { -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) _refreshControl.attributedTitle = nil; -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) return; } @@ -114,10 +114,10 @@ - (void)_updateTitle attributes[NSForegroundColorAttributeName] = RCTUIColorFromSharedColor(concreteProps.titleColor); } -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) _refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:RCTNSStringFromString(concreteProps.title) attributes:attributes]; -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) } #pragma mark - Attaching & Detaching @@ -142,11 +142,11 @@ - (void)_attach return; } -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) if (@available(macOS 13.0, *)) { _scrollViewComponentView.scrollView.refreshControl = _refreshControl; } -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) } - (void)_detach @@ -156,13 +156,13 @@ - (void)_detach } // iOS requires to end refreshing before unmounting. -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) [_refreshControl endRefreshing]; if (@available(macOS 13.0, *)) { _scrollViewComponentView.scrollView.refreshControl = nil; } -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) _scrollViewComponentView = nil; } @@ -175,13 +175,13 @@ - (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args - (void)setNativeRefreshing:(BOOL)refreshing { -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) if (refreshing) { [_refreshControl beginRefreshing]; } else { [_refreshControl endRefreshing]; } -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) } #pragma mark - RCTRefreshableProtocol diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h index 0c15e2f9160d99..cbacc6a0caa974 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h @@ -45,10 +45,10 @@ NS_ASSUME_NONNULL_BEGIN /* * Returns a delegate splitter that can be used to subscribe for UIScrollView delegate. */ -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) @property (nonatomic, strong, readonly) RCTGenericDelegateSplitter> *scrollViewDelegateSplitter; -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) @end diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm index 58a4c490a8ac2b..e99f5b7c2b95d0 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm @@ -28,7 +28,7 @@ static CGFloat const kClippingLeeway = 44.0; -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) static UIScrollViewKeyboardDismissMode RCTUIKeyboardDismissModeFromProps(ScrollViewProps const &props) { switch (props.keyboardDismissMode) { @@ -79,12 +79,12 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(RCTUIScrollView *sc userInfo:userInfo]; } } -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) @interface RCTScrollViewComponentView () < -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) UIScrollViewDelegate, -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) RCTScrollViewProtocol, RCTScrollableProtocol, RCTEnhancedScrollViewOverridingDelegate> @@ -122,9 +122,9 @@ - (instancetype)initWithFrame:(CGRect)frame _scrollView = [[RCTEnhancedScrollView alloc] initWithFrame:self.bounds]; _scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) _scrollView.delaysContentTouches = NO; -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) ((RCTEnhancedScrollView *)_scrollView).overridingDelegate = self; _isUserTriggeredScrolling = NO; _shouldUpdateContentInsetAdjustmentBehavior = YES; @@ -132,9 +132,9 @@ - (instancetype)initWithFrame:(CGRect)frame _containerView = [[RCTUIView alloc] initWithFrame:CGRectZero]; // TODO(macOS GH#774) [_scrollView addSubview:_containerView]; -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) [self.scrollViewDelegateSplitter addDelegate:self]; -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) _scrollEventThrottle = INFINITY; } @@ -146,17 +146,17 @@ - (void)dealloc { // Removing all delegates from the splitter nils the actual delegate which prevents a crash on UIScrollView // deallocation. -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) [self.scrollViewDelegateSplitter removeAllDelegates]; -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) } -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) - (RCTGenericDelegateSplitter> *)scrollViewDelegateSplitter { return ((RCTEnhancedScrollView *)_scrollView).delegateSplitter; } -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) #pragma mark - RCTMountingTransactionObserving @@ -183,9 +183,9 @@ - (void)updateLayoutMetrics:(const LayoutMetrics &)layoutMetrics : CGAffineTransformMakeScale(-1, 1); _containerView.transform = transform; -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) _scrollView.transform = transform; -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) } } @@ -208,25 +208,25 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & // FIXME: Commented props are not supported yet. MAP_SCROLL_VIEW_PROP(alwaysBounceHorizontal); MAP_SCROLL_VIEW_PROP(alwaysBounceVertical); -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) MAP_SCROLL_VIEW_PROP(bounces); MAP_SCROLL_VIEW_PROP(bouncesZoom); MAP_SCROLL_VIEW_PROP(canCancelContentTouches); -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) MAP_SCROLL_VIEW_PROP(centerContent); // MAP_SCROLL_VIEW_PROP(automaticallyAdjustContentInsets); -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) MAP_SCROLL_VIEW_PROP(decelerationRate); MAP_SCROLL_VIEW_PROP(directionalLockEnabled); MAP_SCROLL_VIEW_PROP(maximumZoomScale); MAP_SCROLL_VIEW_PROP(minimumZoomScale); -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) MAP_SCROLL_VIEW_PROP(scrollEnabled); -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) MAP_SCROLL_VIEW_PROP(pagingEnabled); MAP_SCROLL_VIEW_PROP(pinchGestureEnabled); MAP_SCROLL_VIEW_PROP(scrollsToTop); -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) MAP_SCROLL_VIEW_PROP(showsHorizontalScrollIndicator); MAP_SCROLL_VIEW_PROP(showsVerticalScrollIndicator); @@ -235,9 +235,9 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & } if (oldScrollViewProps.indicatorStyle != newScrollViewProps.indicatorStyle) { -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) _scrollView.indicatorStyle = RCTUIScrollViewIndicatorStyleFromProps(newScrollViewProps); -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) } if (oldScrollViewProps.scrollEventThrottle != newScrollViewProps.scrollEventThrottle) { @@ -281,7 +281,7 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & scrollView.snapToOffsets = snapToOffsets; } -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) if (@available(iOS 13.0, *)) { if (oldScrollViewProps.automaticallyAdjustsScrollIndicatorInsets != newScrollViewProps.automaticallyAdjustsScrollIndicatorInsets) { @@ -304,15 +304,15 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & } _shouldUpdateContentInsetAdjustmentBehavior = NO; } -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) MAP_SCROLL_VIEW_PROP(disableIntervalMomentum); MAP_SCROLL_VIEW_PROP(snapToInterval); if (oldScrollViewProps.keyboardDismissMode != newScrollViewProps.keyboardDismissMode) { -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) scrollView.keyboardDismissMode = RCTUIKeyboardDismissModeFromProps(newScrollViewProps); -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) } [super updateProps:props oldProps:oldProps]; @@ -422,9 +422,9 @@ - (void)prepareForRecycle // We set the default behavior to "never" so that iOS // doesn't do weird things to UIScrollView insets automatically // and keeps it as an opt-in behavior. -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) _scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) _shouldUpdateContentInsetAdjustmentBehavior = YES; _state.reset(); _isUserTriggeredScrolling = NO; @@ -455,9 +455,9 @@ - (void)scrollViewDidScroll:(RCTUIScrollView *)scrollView // TODO(macOS GH#774) if (_eventEmitter) { std::static_pointer_cast(_eventEmitter)->onScroll([self _scrollViewMetrics]); } -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) RCTSendScrollEventForNativeAnimations_DEPRECATED(scrollView, self.tag); -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) } [self _remountChildrenIfNeeded]; @@ -591,9 +591,9 @@ - (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args - (void)flashScrollIndicators { -#if !TARGET_OS_OSX // ]TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) [_scrollView flashScrollIndicators]; -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) } - (void)scrollTo:(double)x y:(double)y animated:(BOOL)animated @@ -661,10 +661,10 @@ - (void)_remountChildrenIfNeeded - (void)_remountChildren { -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) [_scrollView updateClippedSubviewsWithClipRect:CGRectInset(_scrollView.bounds, -kClippingLeeway, -kClippingLeeway) relativeToView:_scrollView]; -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) } #pragma mark - RCTScrollableProtocol @@ -710,7 +710,7 @@ - (void)zoomToRect:(CGRect)rect animated:(BOOL)animated #endif // TODO(macOS GH#774) } -#if !TARGET_OS_OSX // [TODO(macOS GH#774) +#if !TARGET_OS_OSX // TODO(macOS GH#774) - (void)addScrollListener:(NSObject *)scrollListener { [self.scrollViewDelegateSplitter addDelegate:scrollListener]; @@ -720,7 +720,7 @@ - (void)removeScrollListener:(NSObject *)scrollListener { [self.scrollViewDelegateSplitter removeDelegate:scrollListener]; } -#endif // ]TODO(macOS GH#774) +#endif // TODO(macOS GH#774) @end