From 464080193993525ee575f3ef1d0fd061059f36ef Mon Sep 17 00:00:00 2001 From: Levi McCallum Date: Tue, 23 Feb 2016 09:36:11 -0800 Subject: [PATCH 1/2] Enable animated bounds changes in ASCollectionView --- AsyncDisplayKit/ASCollectionView.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AsyncDisplayKit/ASCollectionView.mm b/AsyncDisplayKit/ASCollectionView.mm index 77fc3dd60d..9150c5170a 100644 --- a/AsyncDisplayKit/ASCollectionView.mm +++ b/AsyncDisplayKit/ASCollectionView.mm @@ -645,7 +645,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; if (_ignoreMaxSizeChange) { _ignoreMaxSizeChange = NO; } else { - [self performBatchAnimated:NO updates:^{ + [self performBatchAnimated:YES updates:^{ [_dataController relayoutAllNodes]; } completion:nil]; } From c2d379f8f55eb232826567bed02b2dde1e6cd554 Mon Sep 17 00:00:00 2001 From: Levi McCallum Date: Tue, 23 Feb 2016 13:02:37 -0800 Subject: [PATCH 2/2] Add a bit of documentation to describe the problem this is solving --- AsyncDisplayKit/ASCollectionView.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AsyncDisplayKit/ASCollectionView.mm b/AsyncDisplayKit/ASCollectionView.mm index 9150c5170a..2bdbb1d641 100644 --- a/AsyncDisplayKit/ASCollectionView.mm +++ b/AsyncDisplayKit/ASCollectionView.mm @@ -645,6 +645,9 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; if (_ignoreMaxSizeChange) { _ignoreMaxSizeChange = NO; } else { + // This actually doesn't perform an animation, but prevents the transaction block from being processed in the + // data controller's prevent animation block that would interupt an interupted relayout happening in an animation block + // ie. ASCollectionView bounds change on rotation or mutl-tasking split view resize. [self performBatchAnimated:YES updates:^{ [_dataController relayoutAllNodes]; } completion:nil];