-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Rejigger Cell Visibility Tracking #317
Conversation
🚫 CI failed with log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Adlai-Holler this is a nontrivial patch! Thanks for creating it on a holiday!
Everything here looks good to me. I think we should land this and push out a release as soon as practical, although we might want to get additional reviews (e.g. from @nguyenhuy) or at least get a certain pure-Texture app running against it to look for any subtle issues :).
[_rangeController setNeedsUpdate]; | ||
return; | ||
} | ||
auto cell = (_ASCollectionViewCell *)rawCell; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
y hallo there, auto
Generated by 🚫 Danger |
Super :) Ok
Spark by Readdle
|
Let's land this and get it tested. I'll keep an eye on its behavior and fix any regressions. |
* Rejigger visible elements tracking * Put the assertion back * Remove unused stuff * Make it stronk
cc #145 . I never had a reliable repro for it, so I'm counting on the community to test this patch.
willDisplayCell
anddidEndDisplayingCell
are the authoritative sources for what elements are visible. Elements may be visible in multiple cells e.g. during animations, so we use a counted set.(weak)_ASCollectionViewCell.node
with(strong)_ASCollectionViewCell.element
.NSCountedSet<ASCollectionElement *> *_visibleElements
to collection view.willDisplayCell:
anddidEndDisplayingCell:
, add/remove the cell's element from the visible set.visibleElementsForRangeController:
to just return a copy of this set.