Ensure layout controller exposes only cell item index paths to range controller

This commit is contained in:
Levi McCallum
2015-10-13 20:45:40 -07:00
parent 55c1b8f6e7
commit 8b7ac3c37d

View File

@@ -137,8 +137,10 @@ typedef struct ASRangeGeometry ASRangeGeometry;
NSMutableSet *indexPathSet = [[NSMutableSet alloc] init]; NSMutableSet *indexPathSet = [[NSMutableSet alloc] init];
NSArray *layoutAttributes = [_collectionViewLayout layoutAttributesForElementsInRect:rangeBounds]; NSArray *layoutAttributes = [_collectionViewLayout layoutAttributesForElementsInRect:rangeBounds];
for (UICollectionViewLayoutAttributes *la in layoutAttributes) { for (UICollectionViewLayoutAttributes *la in layoutAttributes) {
if (la.representedElementCategory == UICollectionElementCategoryCell) {
[indexPathSet addObject:la.indexPath]; [indexPathSet addObject:la.indexPath];
} }
}
return indexPathSet; return indexPathSet;
} }