add completion block to reloadData methods

This commit is contained in:
Ethan Nagel
2015-03-26 16:32:44 -07:00
parent dd10fda42c
commit 3f509dbd2f
6 changed files with 36 additions and 6 deletions

View File

@@ -437,7 +437,7 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
});
}
- (void)reloadDataWithAnimationOption:(ASDataControllerAnimationOptions)animationOption
- (void)reloadDataWithAnimationOption:(ASDataControllerAnimationOptions)animationOption completion:(void (^)())completion
{
[self performDataFetchingWithBlock:^{
// Fetching data in calling thread
@@ -478,6 +478,10 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
}];
[self _batchInsertNodes:updatedNodes atIndexPaths:updatedIndexPaths withAnimationOptions:animationOption];
if (completion) {
dispatch_async(dispatch_get_main_queue(), completion);
}
});
}];
}