From f96d7ae6486eb245496c0fef07239ae0480e88b6 Mon Sep 17 00:00:00 2001 From: Peter Argany Date: Tue, 27 Mar 2018 17:56:05 -0700 Subject: [PATCH] Bridged FBPullToRefresh to JS Reviewed By: shergin Differential Revision: D6875099 fbshipit-source-id: 00bbad7569ff047a77f198ad2bf4d77fccbaa2e9 --- React/Views/ScrollView/RCTScrollView.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/React/Views/ScrollView/RCTScrollView.m b/React/Views/ScrollView/RCTScrollView.m index f146ba0d2..f2d4da1ec 100644 --- a/React/Views/ScrollView/RCTScrollView.m +++ b/React/Views/ScrollView/RCTScrollView.m @@ -443,6 +443,11 @@ static inline void RCTApplyTransformationAccordingLayoutDirection(UIView *view, #if !TARGET_OS_TV if ([view isKindOfClass:[RCTRefreshControl class]]) { [_scrollView setRctRefreshControl:(RCTRefreshControl *)view]; + } + else if ([view conformsToProtocol:@protocol(UIScrollViewDelegate)]) { + [self addScrollListener:(UIView *)view]; + [_scrollView addSubview:view]; + [_scrollView sendSubviewToBack:view]; } else #endif { @@ -459,6 +464,9 @@ static inline void RCTApplyTransformationAccordingLayoutDirection(UIView *view, #if !TARGET_OS_TV if ([subview isKindOfClass:[RCTRefreshControl class]]) { [_scrollView setRctRefreshControl:nil]; + } else if ([subview conformsToProtocol:@protocol(UIScrollViewDelegate)]) { + [self removeScrollListener:(UIView *)subview]; + [subview removeFromSuperview]; } else #endif {