From 4c4948b6e83208cd517dd977b3462b1959505e1d Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 28 Oct 2019 00:05:21 -0700 Subject: [PATCH] Fix unrecognised selector crash on iOS 9 Summary: Refresh control is only available in iOS 10+ > https://developer.apple.com/documentation/uikit/uiscrollview/2127691-refreshcontrol?language=objc changelog: Fix crash in `RCTPullToRefreshViewComponentView` on iOS 10 Reviewed By: cpojer Differential Revision: D18161020 fbshipit-source-id: c789433f132e68fc71c875e1da79bfe4fd799a44 --- .../ScrollView/RCTPullToRefreshViewComponentView.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm index 0ae1123a82b475..a59b42a45f67b5 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm @@ -125,7 +125,9 @@ - (void)_attach return; } - _scrollViewComponentView.scrollView.refreshControl = _refreshControl; + if (@available(iOS 10.0, macOS 13.0, *)) { + _scrollViewComponentView.scrollView.refreshControl = _refreshControl; + } } - (void)_detach