Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions AsyncDisplayKit/Details/ASCollectionDataController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ - (instancetype)initWithAsyncDataFetching:(BOOL)asyncDataFetchingEnabled

- (void)prepareForReloadData
{
NSArray *kinds = [self supplementaryKinds];
for (NSString *kind in kinds) {
for (NSString *kind in [self supplementaryKinds]) {
LOG(@"Populating elements of kind: %@", kind);
NSMutableArray *indexPaths = [NSMutableArray array];
NSMutableArray *nodes = [NSMutableArray array];
Expand Down Expand Up @@ -83,8 +82,7 @@ - (void)willReloadData

- (void)prepareForInsertSections:(NSIndexSet *)sections
{
NSArray *kinds = [self supplementaryKinds];
for (NSString *kind in kinds) {
for (NSString *kind in [self supplementaryKinds]) {
LOG(@"Populating elements of kind: %@, for sections: %@", kind, sections);
NSMutableArray *nodes = [NSMutableArray array];
NSMutableArray *indexPaths = [NSMutableArray array];
Expand Down Expand Up @@ -116,8 +114,7 @@ - (void)willInsertSections:(NSIndexSet *)sections

- (void)willDeleteSections:(NSIndexSet *)sections
{
NSArray *kinds = [self supplementaryKinds];
for (NSString *kind in kinds) {
for (NSString *kind in [self supplementaryKinds]) {
NSArray *indexPaths = ASIndexPathsForMultidimensionalArrayAtIndexSet([self editingNodesOfKind:kind], sections);

[self deleteNodesOfKind:kind atIndexPaths:indexPaths completion:nil];
Expand All @@ -127,8 +124,7 @@ - (void)willDeleteSections:(NSIndexSet *)sections

- (void)prepareForReloadSections:(NSIndexSet *)sections
{
NSArray *kinds = [self supplementaryKinds];
for (NSString *kind in kinds) {
for (NSString *kind in [self supplementaryKinds]) {
NSMutableArray *nodes = [NSMutableArray array];
NSMutableArray *indexPaths = [NSMutableArray array];
[self _populateSupplementaryNodesOfKind:kind withSections:sections mutableNodes:nodes mutableIndexPaths:indexPaths];
Expand All @@ -154,8 +150,7 @@ - (void)willReloadSections:(NSIndexSet *)sections

- (void)willMoveSection:(NSInteger)section toSection:(NSInteger)newSection
{
NSArray *kinds = [self supplementaryKinds];
for (NSString *kind in kinds) {
for (NSString *kind in [self supplementaryKinds]) {
NSArray *indexPaths = ASIndexPathsForMultidimensionalArrayAtIndexSet([self editingNodesOfKind:kind], [NSIndexSet indexSetWithIndex:section]);
NSArray *nodes = ASFindElementsInMultidimensionalArrayAtIndexPaths([self editingNodesOfKind:kind], indexPaths);
[self deleteNodesOfKind:kind atIndexPaths:indexPaths completion:nil];
Expand Down