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

[RFC] API to Let Existing Cell Nodes Prevent Reload #195

Closed
garrettmoon opened this issue May 1, 2017 · 3 comments
Closed

[RFC] API to Let Existing Cell Nodes Prevent Reload #195

garrettmoon opened this issue May 1, 2017 · 3 comments

Comments

@garrettmoon
Copy link
Member

From @Adlai-Holler on February 23, 2017 18:49

A lot of the time, when something changes in the data model, the existing cell node can be updated to account for it rather than actually calling -[UICollectionView reloadItemsAtIndexPaths:] which causes a new cell node to be created, and a ton of overhead.

Maybe when they call reloadItemsAtIndexPaths: on us, we can call- (BOOL)shouldReload on all the nodes for the reloaded items and give them a chance to update themselves and prevent the reload.

Thoughts @nguyenhuy @garrettmoon @maicki @appleguy @ay8s

Copied from original issue: facebookarchive/AsyncDisplayKit#3067

@garrettmoon
Copy link
Member Author

From @nguyenhuy on February 23, 2017 19:5

I love this idea. This new API will also work nicely with relayout, because most cell nodes can update to adopt to a new size range. The way relayout works right now is, at best, not ideal and is destined for a revisit soonish.

I'm not entirely sure, but we may need it to be -(BOOL)shouldReloadForSizeRange:(ASSizeRange).

@garrettmoon
Copy link
Member Author

From @ay8s on February 23, 2017 22:32

Thanks for thinking through this one @Adlai-Holler. 👍

This sounds great for us as we often have minor changes to cells when updates are removed or reordered in Buffer queues. When that occurs then we usually have to reload the whole cell when really the only visual change is the time label for when the post is scheduled to go out.

@nguyenhuy
Copy link
Member

Implemented in #357.

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

No branches or pull requests

2 participants