mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
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:
@@ -322,14 +322,26 @@ 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 UITableView'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 UITableView's version, this method
|
||||
* is not called when the row is about to display.
|
||||
*/
|
||||
- (ASCellNode *)tableView:(ASTableView *)tableView nodeForRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
* Similar to -tableView:nodeForRowAtIndexPath:.
|
||||
*
|
||||
* @param tableView 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)tableView:(ASTableView *)tableView nodeBlockForRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||
|
||||
/**
|
||||
* Indicator to lock the data source for data fetching in async mode.
|
||||
* We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistence or exception
|
||||
|
||||
Reference in New Issue
Block a user