mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-05-07 08:26:39 +08:00
Batch render supplementary views on reload data
This commit is contained in:
@@ -308,6 +308,9 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
|
||||
|
||||
// Measure nodes whose views are loaded before we leave the main thread
|
||||
[self _layoutNodesWithMainThreadAffinity:updatedNodes atIndexPaths:updatedIndexPaths];
|
||||
|
||||
// Allow subclasses to perform setup before going into the edit transaction
|
||||
[self prepareForReloadData];
|
||||
|
||||
[_editingTransactionQueue addOperationWithBlock:^{
|
||||
ASLOG(@"Edit Transaction - reloadData");
|
||||
@@ -319,6 +322,8 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
|
||||
NSMutableIndexSet *indexSet = [[NSMutableIndexSet alloc] initWithIndexesInRange:NSMakeRange(0, _editingNodes.count)];
|
||||
[self _deleteSectionsAtIndexSet:indexSet withAnimationOptions:animationOptions];
|
||||
|
||||
[self willReloadData];
|
||||
|
||||
// Insert each section
|
||||
NSMutableArray *sections = [NSMutableArray arrayWithCapacity:sectionCount];
|
||||
for (int i = 0; i < sectionCount; i++) {
|
||||
@@ -337,6 +342,16 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)prepareForReloadData
|
||||
{
|
||||
// Implemented by subclasses
|
||||
}
|
||||
|
||||
- (void)willReloadData
|
||||
{
|
||||
// Implemented by subclasses
|
||||
}
|
||||
|
||||
#pragma mark - Data Source Access (Calling _dataSource)
|
||||
|
||||
- (void)accessDataSourceWithBlock:(dispatch_block_t)block
|
||||
|
||||
Reference in New Issue
Block a user