Remove numberOfSectionsForSupplementaryNodeOfKind: Method (#2102)

* Add unit test to confirm that supplementary items must be contained within actual sections

* [ASLayoutInspecting] Deprecate collectionView:numberOfSectionsForSupplementaryNodeOfKind:

* Add another test to dig deeper into UICollectionView
This commit is contained in:
Adlai Holler
2016-08-19 11:18:31 -07:00
committed by GitHub
parent cbec803b31
commit 0bd664f9ed
8 changed files with 86 additions and 57 deletions

View File

@@ -65,7 +65,7 @@
[self deleteSectionsOfKind:kind atIndexSet:indexSet completion:nil];
// Insert each section
NSUInteger sectionCount = [self.collectionDataSource dataController:self numberOfSectionsForSupplementaryNodeOfKind:kind];
NSUInteger sectionCount = self.itemCountsFromDataSource.size();
NSMutableArray *sections = [NSMutableArray arrayWithCapacity:sectionCount];
for (int i = 0; i < sectionCount; i++) {
[sections addObject:[NSMutableArray array]];
@@ -194,7 +194,7 @@
ASEnvironmentTraitCollection environmentTraitCollection = environment.environmentTraitCollection;
id<ASCollectionDataControllerSource> source = self.collectionDataSource;
NSUInteger sectionCount = [source dataController:self numberOfSectionsForSupplementaryNodeOfKind:kind];
NSUInteger sectionCount = self.itemCountsFromDataSource.size();
for (NSUInteger i = 0; i < sectionCount; i++) {
NSUInteger rowCount = [source dataController:self supplementaryNodesOfKind:kind inSection:i];
for (NSUInteger j = 0; j < rowCount; j++) {