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

Support for reload instead of delete+insert #60

Open
NinoScript opened this issue May 4, 2017 · 3 comments
Open

Support for reload instead of delete+insert #60

NinoScript opened this issue May 4, 2017 · 3 comments

Comments

@NinoScript
Copy link

NinoScript commented May 4, 2017

I'm exploring using a different animation for reloading a row, for that I would need Dwifft to call reloadItems instead of deleteItems and insertItems.

My first guess is that a adding a naive support for reloads would just require checking for the intersection between deletes and inserts in processChanges(newState:diff:).

What do you think?

@larryonoff
Copy link
Contributor

It maybe reasonable implementing a diffable.diffIdentifier similar like IGListKit. So the library is able to understand that it's the same object, but needs reload.

@alessandro-martin
Copy link

alessandro-martin commented Feb 23, 2018

I think that the best solution is for the API's user to change the way she calculates the sectioned values so a change to the details of an item are reflected and treated as a deletion + insertion.

@r00li
Copy link

r00li commented Jan 23, 2019

I have a problem with this as well. Here is a use case example....

I have cells that include some time interval display (something like: "updated x seconds ago") and a button/tag that can be toggled in other parts of the app as well.

When the user uses pull to refresh the new content is loaded and tableview is updated using calculator.sectionedValues = x. The cells that are added or removed update and animate as they should. The issue is with the cells that haven't changed. So either their data model has stayed completely identical (that "updated x seconds ago") or one of their tags changed but the rest of the content didn't. I would want the cells to be reloaded even though they haven't really changed. The data model here can be completely identical, but I still need the cells to be reloaded.

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

No branches or pull requests

4 participants