diff --git a/React/Views/RefreshControl/RCTRefreshControl.m b/React/Views/RefreshControl/RCTRefreshControl.m index 428a5e7fa40..419535bcb46 100644 --- a/React/Views/RefreshControl/RCTRefreshControl.m +++ b/React/Views/RefreshControl/RCTRefreshControl.m @@ -41,12 +41,6 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder) { [super layoutSubviews]; - // Fix for bug #7976 - // TODO: Remove when updating to use iOS 10 refreshControl UIScrollView prop. - if (self.backgroundColor == nil) { - self.backgroundColor = [UIColor clearColor]; - } - // If the control is refreshing when mounted we need to call // beginRefreshing in layoutSubview or it doesn't work. if (_currentRefreshingState && _isInitialRender) { diff --git a/React/Views/ScrollView/RCTScrollView.m b/React/Views/ScrollView/RCTScrollView.m index 56d63505b9e..bb49c8d7363 100644 --- a/React/Views/ScrollView/RCTScrollView.m +++ b/React/Views/ScrollView/RCTScrollView.m @@ -32,7 +32,7 @@ @property (nonatomic, assign) BOOL centerContent; #if !TARGET_OS_TV -@property (nonatomic, strong) UIView *customRefreshControl; +@property (nonatomic, strong) UIRefreshControl *customRefreshControl; @property (nonatomic, assign) BOOL pinchGestureEnabled; #endif @@ -224,13 +224,13 @@ } #if !TARGET_OS_TV -- (void)setCustomRefreshControl:(UIView *)refreshControl +- (void)setCustomRefreshControl:(UIRefreshControl *)refreshControl { if (_customRefreshControl) { [_customRefreshControl removeFromSuperview]; } _customRefreshControl = refreshControl; - [self addSubview:_customRefreshControl]; + self.refreshControl = refreshControl; } - (void)setPinchGestureEnabled:(BOOL)pinchGestureEnabled @@ -344,7 +344,7 @@ static inline void RCTApplyTransformationAccordingLayoutDirection( [super insertReactSubview:view atIndex:atIndex]; #if !TARGET_OS_TV if ([view conformsToProtocol:@protocol(RCTCustomRefreshContolProtocol)]) { - [_scrollView setCustomRefreshControl:(UIView *)view]; + [_scrollView setCustomRefreshControl:(UIRefreshControl *)view]; if (![view isKindOfClass:[UIRefreshControl class]] && [view conformsToProtocol:@protocol(UIScrollViewDelegate)]) { [self addScrollListener:(UIView *)view]; } @@ -418,16 +418,6 @@ static inline void RCTApplyTransformationAccordingLayoutDirection( [super layoutSubviews]; RCTAssert(self.subviews.count == 1, @"we should only have exactly one subview"); RCTAssert([self.subviews lastObject] == _scrollView, @"our only subview should be a scrollview"); - -#if !TARGET_OS_TV - // Adjust the refresh control frame if the scrollview layout changes. - UIView *refreshControl = _scrollView.customRefreshControl; - if (refreshControl && refreshControl.isRefreshing) { - refreshControl.frame = - (CGRect){_scrollView.contentOffset, {_scrollView.frame.size.width, refreshControl.frame.size.height}}; - } -#endif - [self updateClippedSubviews]; }