- (NSArray<IGListSectionController<IGListSectionType> *> *)visibleSectionControllers; in IGListAdapter is not all visible section controllers sometimes.
For example, in a list, there is a section controller, with zero cell, but there's a header, footer or other supplementary view. So the section controller is still "visible".
Ah ya, we're only using -[UICollectionView visibleCells] atm, but absolutely not perfect. Tracking visible supplementary views is much more complicated b/c
visibleSupplementaryViewsOfKind: is iOS 9+Maybe instead we should query -[UICollectionViewLayout layoutAttributesForElementsInRect:] w/ collectionView.bounds and just nab -[UICollectionViewLayoutAttributes indexPath] to build a set of section controllers?
Should be easy to unit test too.
@rnystrom Want to card that up separately? Seems like a nice starter task!
@rnystrom I took a stab at implementing your fix idea + added a unit test!
Most helpful comment
@rnystrom I took a stab at implementing your fix idea + added a unit test!