Updates exposed method signature and docs for what is now -supplementaryNodeForElementKind:atIndexPath: on ASCollectionView. Assert non-nil for usage of ASCollectionDataControllers -supplementaryNodeOfKind:atIndexPath: within ASCollectionView

This commit is contained in:
Colin McArdell and Robin Chou
2016-06-22 15:41:24 -04:00
parent 1c103333f7
commit 9c13018568
2 changed files with 7 additions and 5 deletions

View File

@@ -444,9 +444,9 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
return [_dataController nodeAtIndexPath:indexPath];
}
- (ASCellNode *)supplementaryNodeOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
- (ASCellNode *)supplementaryNodeForElementKind:(NSString *)elementKind atIndexPath:(NSIndexPath *)indexPath
{
return [_dataController supplementaryNodeOfKind:kind atIndexPath:indexPath];
return [_dataController supplementaryNodeOfKind:elementKind atIndexPath:indexPath];
}
- (NSIndexPath *)indexPathForNode:(ASCellNode *)cellNode
@@ -577,6 +577,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
NSString *identifier = [self __reuseIdentifierForKind:kind];
UICollectionReusableView *view = [self dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:identifier forIndexPath:indexPath];
ASCellNode *node = [_dataController supplementaryNodeOfKind:kind atIndexPath:indexPath];
ASDisplayNodeAssert(node != nil, @"Supplementary node should exist. Kind = %@, indexPath = %@, collectionDataSource = %@", kind, indexPath, self);
[_rangeController configureContentView:view forCellNode:node];
return view;
}