Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RTL] Guard access of flipsHorizontallyInOppositeLayoutDirection for iOS >= 11 #2003

Merged
merged 1 commit into from
Jun 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[RTL] Guard access of flipsHorizontallyInOppositeLayoutDirection for …
…iOS >= 11

`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.
  • Loading branch information
rcancro committed Jun 3, 2021
commit d7daf9897fd0bba12a87a2deab84e0a7e4ac7dcd
7 changes: 5 additions & 2 deletions Source/ASCollectionView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
Expand Down