diff --git a/AsyncDisplayKit/ASCollectionView.h b/AsyncDisplayKit/ASCollectionView.h index 6314da2604..abf25ec809 100644 --- a/AsyncDisplayKit/ASCollectionView.h +++ b/AsyncDisplayKit/ASCollectionView.h @@ -67,6 +67,13 @@ */ - (void)appendNodesWithIndexPaths:(NSArray *)indexPaths; +/** + * Query the sized node at `indexPath` for its calculatedSize. + * + * @param indexPath The index path for the node of interest. + */ +- (CGSize)calculatedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath; + @end diff --git a/AsyncDisplayKit/ASCollectionView.m b/AsyncDisplayKit/ASCollectionView.m index 04ec601cdf..aa20fe36bd 100644 --- a/AsyncDisplayKit/ASCollectionView.m +++ b/AsyncDisplayKit/ASCollectionView.m @@ -170,6 +170,11 @@ static BOOL _isInterceptedSelector(SEL sel) [_rangeController appendNodesWithIndexPaths:indexPaths]; } +- (CGSize)calculatedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath +{ + return [_rangeController calculatedSizeForNodeAtIndexPath:indexPath]; +} + #pragma mark Assertions. - (void)throwUnimplementedException