Instagram / IGListKit

A data-driven UICollectionView framework for building fast and flexible lists.
https://instagram.github.io/IGListKit/
MIT License
12.9k stars 1.54k forks source link

Method to Get Old Index Path for New Index Path in Update #672

Open Adlai-Holler opened 7 years ago

Adlai-Holler commented 7 years ago

In https://github.com/TextureGroup/Texture we're looking to support using NodeControllers for each item, and having the NodeController survive across object updates (reloadItemsAtIndexPaths:) just like IGListSectionControllers do.

Since IGListKit submits reloads as delete/insert pairs, I can't see any public way for us to find out whether, in a given batch update, an insert corresponds to a delete – if an item was updated.

@rnystrom @jessesquires Would you be willing to support that or point me in the right direction?

jessesquires commented 7 years ago

Is this the same as #546?

Adlai-Holler commented 7 years ago

It's like that issue, except for reloads rather than moves.

rnystrom commented 7 years ago

We could probably look into adding that after #657 lands. This is similar to #297 as well.

We can do this pretty easily w/out bothering to support UICollectionViewLayout (specifically UICollectionUpdateActionReload). We can add our new batch update reload pairs onto IGListBatchUpdateData.

@Adlai-Holler what sort of support are you thinking?

jessesquires commented 7 years ago

Currently seems additive, so marking this for 3.1

jessesquires commented 6 years ago

Bumped this to new 3.5.0 milestone since 3.4.0 was released already.

jessesquires commented 6 years ago

Nevermind, bumped to 4.0 since that's the next release. 😄

iperry90 commented 5 years ago

Bumping this to 4.1.0 since we don't have a need for this at Instagram right now. We would be happy to review and accept a PR if anyone wants to take this on.