Move ASCellNode allocation off the main thread by the addition of a node block

API in ASDataController. Move allocations and loaded node layouts to occur
during batch layout phase.
This commit is contained in:
Rahul Malik
2016-02-02 15:00:24 -08:00
parent 35a4b268d6
commit 521c3fa1c1
14 changed files with 306 additions and 48 deletions

View File

@@ -347,14 +347,25 @@ NS_ASSUME_NONNULL_BEGIN
*
* @param indexPath The index path of the requested node.
*
* @returns a node for display at this indexpath. Must be thread-safe (can be called on the main thread or a background
* queue) and should not implement reuse (it will be called once per row). Unlike UICollectionView's version, this method
* @returns a node for display at this indexpath. This will be called on the main thread and should not implement reuse (it will be called once per row). Unlike UICollectionView's version, this method
* is not called when the row is about to display.
*/
- (ASCellNode *)collectionView:(ASCollectionView *)collectionView nodeForItemAtIndexPath:(NSIndexPath *)indexPath;
@optional
/**
*
* @param collectionView The sender.
*
* @param indexPath The index path of the requested node.
*
* @returns a block that creates the node for display at this indexpath. Must be thread-safe (can be called on the main thread or a background
* queue) and should not implement reuse (it will be called once per row).
*/
- (ASDataControllerCellNodeBlock)collectionView:(ASCollectionView *)collectionView nodeBlockAtIndexPath:(NSIndexPath *)indexPath;
/**
* Asks the collection view to provide a supplementary node to display in the collection view.
*