diff --git a/AsyncDisplayKit/ASCellNode.mm b/AsyncDisplayKit/ASCellNode.mm index 151578d7..c5cbda37 100644 --- a/AsyncDisplayKit/ASCellNode.mm +++ b/AsyncDisplayKit/ASCellNode.mm @@ -115,13 +115,35 @@ [self didRelayoutFromOldSize:oldSize toNewSize:self.calculatedSize]; } -- (void)transitionLayoutWithAnimation:(BOOL)animated - shouldMeasureAsync:(BOOL)shouldMeasureAsync - measurementCompletion:(void(^)())completion +- (void)transitionLayoutAnimated:(BOOL)animated + measurementCompletion:(void (^)())completion { CGSize oldSize = self.calculatedSize; - [super transitionLayoutWithAnimation:animated - shouldMeasureAsync:shouldMeasureAsync + [super transitionLayoutAnimated:animated + measurementCompletion:^{ + [self didRelayoutFromOldSize:oldSize toNewSize:self.calculatedSize]; + if (completion) { + completion(); + } + } + ]; +} + +//Deprecated +- (void)transitionLayoutWithAnimation:(BOOL)animated + shouldMeasureAsync:(BOOL)shouldMeasureAsync + measurementCompletion:(void(^)())completion +{ + [self transitionLayoutAnimated:animated measurementCompletion:completion]; +} + +- (void)transitionLayoutWithSizeRange:(ASSizeRange)constrainedSize + animated:(BOOL)animated + measurementCompletion:(void (^)())completion +{ + CGSize oldSize = self.calculatedSize; + [super transitionLayoutWithSizeRange:constrainedSize + animated:animated measurementCompletion:^{ [self didRelayoutFromOldSize:oldSize toNewSize:self.calculatedSize]; if (completion) { @@ -131,22 +153,13 @@ ]; } +//Deprecated - (void)transitionLayoutWithSizeRange:(ASSizeRange)constrainedSize animated:(BOOL)animated shouldMeasureAsync:(BOOL)shouldMeasureAsync measurementCompletion:(void(^)())completion { - CGSize oldSize = self.calculatedSize; - [super transitionLayoutWithSizeRange:constrainedSize - animated:animated - shouldMeasureAsync:shouldMeasureAsync - measurementCompletion:^{ - [self didRelayoutFromOldSize:oldSize toNewSize:self.calculatedSize]; - if (completion) { - completion(); - } - } - ]; + [self transitionLayoutWithSizeRange:constrainedSize animated:animated measurementCompletion:completion]; } - (void)didRelayoutFromOldSize:(CGSize)oldSize toNewSize:(CGSize)newSize