mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Add first-pass view model support to collection node. #trivial (#356)
* Add first-pass view model support for collection node. Much more to come! * Address issues * Update the gorram license header * Dear lord
This commit is contained in:
@@ -418,6 +418,17 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (nullable __kindof ASCellNode *)nodeForItemAtIndexPath:(NSIndexPath *)indexPath AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
* Retrieves the view-model for the item at the given index path, if any.
|
||||
*
|
||||
* @param indexPath The index path of the requested item.
|
||||
*
|
||||
* @return The view-model for the given item, or @c nil if no item exists at the specified path or no view-model was provided.
|
||||
*
|
||||
* @warning This API is beta and subject to change. We'll try to provide an easy migration path.
|
||||
*/
|
||||
- (nullable id)viewModelForItemAtIndexPath:(NSIndexPath *)indexPath AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
* Retrieve the index path for the item with the given node.
|
||||
*
|
||||
@@ -503,6 +514,17 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (NSInteger)numberOfSectionsInCollectionNode:(ASCollectionNode *)collectionNode;
|
||||
|
||||
/**
|
||||
* --BETA--
|
||||
* Asks the data source for a view-model for the item at the given index path.
|
||||
*
|
||||
* @param collectionNode The sender.
|
||||
* @param indexPath The index path of the item.
|
||||
*
|
||||
* @return An object that contains all the data for this item.
|
||||
*/
|
||||
- (nullable id)collectionNode:(ASCollectionNode *)collectionNode viewModelForItemAtIndexPath:(NSIndexPath *)indexPath;
|
||||
|
||||
/**
|
||||
* Similar to -collectionNode:nodeForItemAtIndexPath:
|
||||
* This method takes precedence over collectionNode:nodeForItemAtIndexPath: if implemented.
|
||||
|
||||
Reference in New Issue
Block a user