DifferenceKit icon indicating copy to clipboard operation
DifferenceKit copied to clipboard

How to use DifferenceKit with diffable data sources?

Open tinder-cfuller opened this issue 9 months ago • 2 comments

Checklist

Detailed Description

How to use DifferenceKit with diffable data sources?

let stagedChangeset = StagedChangeset(source: dataStore.elements, target: newElements)

for changeset in stagedChangeset {

    dataStore.elements = changeset.data

    var snapshot = dataSource.snapshot()

    // What to do here?

    dataSource.apply(snapshot, animatingDifferences: true)
}

While each element can be Identifiable to provide identifiers for the various snapshot methods, it is not clear how to process the changesets.

Please explain in detail how to accomplish this or kindly consider adding methods to the library similar to the existing UIKit/AppKit extensions. Thank you!

tinder-cfuller avatar May 14 '24 17:05 tinder-cfuller