DifferenceKit
DifferenceKit copied to clipboard
How to use DifferenceKit with diffable data sources?
Checklist
- [x] Reviewed the README and documents.
- [x] Searched existing issues for ensure not duplicated.
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!