mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-13 18:00:17 +00:00
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:
parent
1c103333f7
commit
9c13018568
@ -284,13 +284,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
/**
|
||||
* Similar to -collectionView:viewForSupplementaryElementOfKind:atIndexPath:.
|
||||
* Similar to -supplementaryViewForElementKind:atIndexPath:
|
||||
*
|
||||
* @param elementKind The kind of supplementary node to locate.
|
||||
* @param indexPath The index path of the requested supplementary node.
|
||||
*
|
||||
* @returns a supplementary node for display at this indexpath or nil
|
||||
* @returns The specified supplementary node or nil
|
||||
*/
|
||||
- (nullable ASCellNode *)supplementaryNodeOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath;
|
||||
- (nullable ASCellNode *)supplementaryNodeForElementKind:(NSString *)elementKind atIndexPath:(NSIndexPath *)indexPath;
|
||||
|
||||
/**
|
||||
* Similar to -indexPathForCell:.
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user