Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 513b9f4

Browse files
author
Adlai Holler
authored
Remove unused and unusable implementations of moveItem: and moveSection: (#2863)
1 parent d65fe8b commit 513b9f4

1 file changed

Lines changed: 2 additions & 57 deletions

File tree

AsyncDisplayKit/Details/ASDataController.mm

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -672,40 +672,7 @@ - (void)reloadSections:(NSIndexSet *)sections withAnimationOptions:(ASDataContro
672672

673673
- (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
674674
{
675-
ASDisplayNodeAssertMainThread();
676-
LOG(@"Edit Command - moveSection");
677-
678-
if (!_initialReloadDataHasBeenCalled) {
679-
return;
680-
}
681-
682-
NSMutableArray *rowContexts = _nodeContexts[ASDataControllerRowNodeKind];
683-
NSArray *contexts = rowContexts[section];
684-
[rowContexts removeObjectAtIndex:section];
685-
[rowContexts insertObject:contexts atIndex:section];
686-
687-
dispatch_group_wait(_editingTransactionGroup, DISPATCH_TIME_FOREVER);
688-
dispatch_group_async(_editingTransactionGroup, _editingTransactionQueue, ^{
689-
[self willMoveSection:section toSection:newSection];
690-
691-
// remove elements
692-
693-
LOG(@"Edit Transaction - moveSection");
694-
NSMutableArray *editingRows = _editingNodes[ASDataControllerRowNodeKind];
695-
NSArray *indexPaths = ASIndexPathsForMultidimensionalArrayAtIndexSet(editingRows, [NSIndexSet indexSetWithIndex:section]);
696-
NSArray *nodes = ASFindElementsInMultidimensionalArrayAtIndexPaths(editingRows, indexPaths);
697-
[self _deleteNodesAtIndexPaths:indexPaths withAnimationOptions:animationOptions];
698-
699-
// update the section of indexpaths
700-
NSMutableArray *updatedIndexPaths = [[NSMutableArray alloc] initWithCapacity:indexPaths.count];
701-
for (NSIndexPath *indexPath in indexPaths) {
702-
NSIndexPath *updatedIndexPath = [NSIndexPath indexPathForItem:indexPath.item inSection:newSection];
703-
[updatedIndexPaths addObject:updatedIndexPath];
704-
}
705-
706-
// Don't re-calculate size for moving
707-
[self _insertNodes:nodes atIndexPaths:updatedIndexPaths withAnimationOptions:animationOptions];
708-
});
675+
ASDisplayNodeAssert(NO, @"ASDataController does not support %@. Call this on ASChangeSetDataController and the move will be processed along with the current batch of updates.", NSStringFromSelector(_cmd));
709676
}
710677

711678

@@ -878,29 +845,7 @@ - (void)_relayoutNodesOfKind:(NSString *)kind
878845

879846
- (void)moveRowAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
880847
{
881-
ASDisplayNodeAssertMainThread();
882-
if (!_initialReloadDataHasBeenCalled) {
883-
return;
884-
}
885-
886-
NSMutableArray *contexts = _nodeContexts[ASDataControllerRowNodeKind];
887-
ASIndexedNodeContext *context = contexts[indexPath.section][indexPath.item];
888-
[contexts[indexPath.section] removeObjectAtIndex:indexPath.item];
889-
[contexts[newIndexPath.section] insertObject:context atIndex:newIndexPath.item];
890-
891-
LOG(@"Edit Command - moveRow: %@ > %@", indexPath, newIndexPath);
892-
dispatch_group_wait(_editingTransactionGroup, DISPATCH_TIME_FOREVER);
893-
894-
dispatch_group_async(_editingTransactionGroup, _editingTransactionQueue, ^{
895-
LOG(@"Edit Transaction - moveRow: %@ > %@", indexPath, newIndexPath);
896-
NSArray *indexPaths = @[indexPath];
897-
NSArray *nodes = ASFindElementsInMultidimensionalArrayAtIndexPaths(_editingNodes[ASDataControllerRowNodeKind], indexPaths);
898-
[self _deleteNodesAtIndexPaths:indexPaths withAnimationOptions:animationOptions];
899-
900-
// Don't re-calculate size for moving
901-
NSArray *newIndexPaths = @[newIndexPath];
902-
[self _insertNodes:nodes atIndexPaths:newIndexPaths withAnimationOptions:animationOptions];
903-
});
848+
ASDisplayNodeAssert(NO, @"ASDataController does not support %@. Call this on ASChangeSetDataController and the move will be processed along with the current batch of updates.", NSStringFromSelector(_cmd));
904849
}
905850

906851
#pragma mark - Data Querying (Subclass API)

0 commit comments

Comments
 (0)