From 86a5aece9c48f070c103165ef4b6cff556e812a1 Mon Sep 17 00:00:00 2001 From: Garrett Moon Date: Mon, 24 Oct 2016 14:05:03 -0700 Subject: [PATCH] Caching scrollable directions is not safe (#2474) --- .../Details/ASCollectionViewLayoutController.mm | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/AsyncDisplayKit/Details/ASCollectionViewLayoutController.mm b/AsyncDisplayKit/Details/ASCollectionViewLayoutController.mm index 6672fb7b2a..14d1a0021e 100644 --- a/AsyncDisplayKit/Details/ASCollectionViewLayoutController.mm +++ b/AsyncDisplayKit/Details/ASCollectionViewLayoutController.mm @@ -30,7 +30,6 @@ typedef struct ASRangeGeometry ASRangeGeometry; @package ASCollectionView * __weak _collectionView; UICollectionViewLayout * __strong _collectionViewLayout; - ASScrollDirection _scrollableDirections; } @end @@ -42,7 +41,6 @@ typedef struct ASRangeGeometry ASRangeGeometry; return nil; } - _scrollableDirections = [collectionView scrollableDirections]; _collectionView = collectionView; _collectionViewLayout = [collectionView collectionViewLayout]; return self; @@ -74,12 +72,7 @@ typedef struct ASRangeGeometry ASRangeGeometry; { CGRect rect = _collectionView.bounds; - // Scrollable directions can change for non-flow layouts - if ([_collectionViewLayout asdk_isFlowLayout] == NO) { - _scrollableDirections = [_collectionView scrollableDirections]; - } - - return CGRectExpandToRangeWithScrollableDirections(rect, tuningParameters, _scrollableDirections, scrollDirection); + return CGRectExpandToRangeWithScrollableDirections(rect, tuningParameters, [_collectionView scrollableDirections], scrollDirection); } @end