From 03e7d1fabd7568b611ea48eecb18332a7498a683 Mon Sep 17 00:00:00 2001 From: ricky Date: Thu, 3 Jun 2021 11:19:45 -0700 Subject: [PATCH] [RTL] Guard access of flipsHorizontallyInOppositeLayoutDirection for iOS >= 11 (#2003) `flipsHorizontallyInOppositeLayoutDirection` is available in iOS11 and greater. Texture still supports iOS9 so we need to make sure not to call this it in those cases. --- Source/ASCollectionView.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/ASCollectionView.mm b/Source/ASCollectionView.mm index 743f7660f..e08c55f98 100644 --- a/Source/ASCollectionView.mm +++ b/Source/ASCollectionView.mm @@ -1859,8 +1859,11 @@ - (void)_beginBatchFetchingIfNeededWithContentOffset:(CGPoint)contentOffset velo { // Since we are accessing self.collectionViewLayout, we should make sure we are on main ASDisplayNodeAssertMainThread(); - - if (ASDisplayShouldFetchBatchForScrollView(self, self.scrollDirection, self.scrollableDirections, contentOffset, velocity, self.collectionViewLayout.flipsHorizontallyInOppositeLayoutDirection)) { + BOOL flipsHorizontallyInOppositeLayoutDirection = NO; + if (AS_AVAILABLE_IOS(11.0)) { + flipsHorizontallyInOppositeLayoutDirection = self.collectionViewLayout.flipsHorizontallyInOppositeLayoutDirection; + } + if (ASDisplayShouldFetchBatchForScrollView(self, self.scrollDirection, self.scrollableDirections, contentOffset, velocity, flipsHorizontallyInOppositeLayoutDirection)) { [self _beginBatchFetching]; } }