Delete supplementary nodes when section is deleted

This commit is contained in:
Levi McCallum
2015-10-06 12:03:16 -07:00
parent e1ea2d2151
commit d77df45bfd

View File

@@ -103,6 +103,17 @@
}
- (void)willDeleteSections:(NSIndexSet *)sections
{
NSArray *elementKinds = [self.collectionDataSource supplementaryNodeKindsInDataController:self];
[elementKinds enumerateObjectsUsingBlock:^(NSString *kind, NSUInteger idx, BOOL *stop) {
NSArray *indexPaths = ASIndexPathsForMultidimensionalArrayAtIndexSet([self editingNodesOfKind:kind], sections);
[self deleteNodesOfKind:kind atIndexPaths:indexPaths completion:nil];
[self deleteSectionsOfKind:kind atIndexSet:sections completion:nil];
}];
}
- (void)prepareForReloadSections:(NSIndexSet *)sections
{
// TODO: Implement
}