[ASDataController] If app code issues edit commands before first reload, ignore them, as UIKit will call -reloadData.

This commit is contained in:
Scott Goodson 2016-03-05 20:22:18 -08:00
parent cc7ca4a08f
commit 6a32e5ccc0

View File

@ -328,6 +328,9 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
*/
- (void)_insertNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
{
if (indexPaths.count == 0) {
return;
}
[self insertNodes:nodes ofKind:ASDataControllerRowNodeKind atIndexPaths:indexPaths completion:^(NSArray *nodes, NSArray *indexPaths) {
if (_delegateDidInsertNodes)
[_delegate dataController:self didInsertNodes:nodes atIndexPaths:indexPaths withAnimationOptions:animationOptions];
@ -342,6 +345,9 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
*/
- (void)_deleteNodesAtIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
{
if (indexPaths.count == 0) {
return;
}
[self deleteNodesOfKind:ASDataControllerRowNodeKind atIndexPaths:indexPaths completion:^(NSArray *nodes, NSArray *indexPaths) {
if (_delegateDidDeleteNodes)
[_delegate dataController:self didDeleteNodes:nodes atIndexPaths:indexPaths withAnimationOptions:animationOptions];