Skip to content

Commit

Permalink
Fix unrecognised selector crash on iOS 9
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Oct 28, 2019
1 parent aa27645 commit 4c4948b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4c4948b

Please sign in to comment.