Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"visible" section controllers #643

Closed
PhilCai1993 opened this issue Apr 14, 2017 · 3 comments
Closed

"visible" section controllers #643

PhilCai1993 opened this issue Apr 14, 2017 · 3 comments
Assignees

Comments

@PhilCai1993
Copy link
Contributor

PhilCai1993 commented Apr 14, 2017

- (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".

@PhilCai1993 PhilCai1993 changed the title visibleSectionControllers "visible" section controllers Apr 14, 2017
@rnystrom
Copy link
Contributor

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+
  • Requires knowing element kinds ahead of time

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.

@Sherlouk
Copy link
Contributor

@rnystrom Want to card that up separately? Seems like a nice starter task!

manicakes pushed a commit to manicakes/IGListKit that referenced this issue Jul 27, 2017
manicakes pushed a commit to manicakes/IGListKit that referenced this issue Jul 27, 2017
@manicakes
Copy link

@rnystrom I took a stab at implementing your fix idea + added a unit test!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants