Crash on reloadData in collection view when header is offscreen
Hello again @jamztang - found some issues with reloading data on the collection view.
The CSStickyHeaderFlowLayout was calling its base class UICollectionViewLayout layoutAttributesForSupplementaryViewOfKind: method to get layout attributes. That base class knows nothing about the CSStickyHeaderParallaxHeader kind of supplementary view, and was returning nil.
Fix:
- (UICollectionViewLayoutAttributes *)layoutAttributesForSupplementaryViewOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath { UICollectionViewLayoutAttributes *attributes = [super layoutAttributesForSupplementaryViewOfKind:kind atIndexPath:indexPath]; if (!attributes && [kind isEqualToString:CSStickyHeaderParallaxHeader]) { attributes = [CSStickyHeaderFlowLayoutAttributes layoutAttributesForSupplementaryViewOfKind:kind withIndexPath:indexPath]; } return attributes; }