From 2834ba34906df71d01c741d08adba54ef20c77c0 Mon Sep 17 00:00:00 2001 From: Hannah Troisi Date: Mon, 24 Oct 2016 16:10:56 -0700 Subject: [PATCH] [ASPagerNode] Fix ASPagerNodeProxy to use collectionNode (#2475) * Fix ASProxyDelegate to use collectionNode * fix constrainedSize...issue --- AsyncDisplayKit/ASCollectionNode.h | 2 +- AsyncDisplayKit/ASPagerNode.m | 2 ++ AsyncDisplayKit/Details/ASDelegateProxy.m | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/AsyncDisplayKit/ASCollectionNode.h b/AsyncDisplayKit/ASCollectionNode.h index d5d799d68a..2e0c38cf97 100644 --- a/AsyncDisplayKit/ASCollectionNode.h +++ b/AsyncDisplayKit/ASCollectionNode.h @@ -593,7 +593,7 @@ NS_ASSUME_NONNULL_BEGIN * * @return A constrained size range for layout the node at this index path. */ -- (ASSizeRange)collectionView:(ASCollectionView *)collectionView constrainedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode's method instead."); +- (ASSizeRange)collectionView:(ASCollectionView *)collectionView constrainedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode's constrainedSizeForItemAtIndexPath: instead."); /** * Informs the delegate that the collection view will add the given node diff --git a/AsyncDisplayKit/ASPagerNode.m b/AsyncDisplayKit/ASPagerNode.m index 60eb520d58..0b42f2bc19 100644 --- a/AsyncDisplayKit/ASPagerNode.m +++ b/AsyncDisplayKit/ASPagerNode.m @@ -127,6 +127,8 @@ return [_pagerDataSource numberOfPagesInPagerNode:self]; } +#pragma mark - ASCollectionDelegate + - (ASSizeRange)collectionNode:(ASCollectionNode *)collectionNode constrainedSizeForItemAtIndexPath:(NSIndexPath *)indexPath { if (_pagerDelegateImplementsConstrainedSizeForNode) { diff --git a/AsyncDisplayKit/Details/ASDelegateProxy.m b/AsyncDisplayKit/Details/ASDelegateProxy.m index 460c50f0b6..38c32d2f49 100644 --- a/AsyncDisplayKit/Details/ASDelegateProxy.m +++ b/AsyncDisplayKit/Details/ASDelegateProxy.m @@ -116,10 +116,10 @@ { return ( // handled by ASPagerDataSource node<->cell machinery - selector == @selector(collectionView:nodeForItemAtIndexPath:) || - selector == @selector(collectionView:nodeBlockForItemAtIndexPath:) || - selector == @selector(collectionView:numberOfItemsInSection:) || - selector == @selector(collectionView:constrainedSizeForNodeAtIndexPath:) + selector == @selector(collectionNode:nodeForItemAtIndexPath:) || + selector == @selector(collectionNode:nodeBlockForItemAtIndexPath:) || + selector == @selector(collectionNode:numberOfItemsInSection:) || + selector == @selector(collectionNode:constrainedSizeForItemAtIndexPath:) ); }