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

How to apply ChageSet to an array? #156

Open
2 tasks done
Aranoledur opened this issue Sep 18, 2023 · 0 comments
Open
2 tasks done

How to apply ChageSet to an array? #156

Aranoledur opened this issue Sep 18, 2023 · 0 comments

Comments

@Aranoledur
Copy link

Checklist

Detailed Description (Include Screenshots)

So if I have only 1 section in my collection. And I have 2 arrays of elements:

let source: [AnyDifferentiable] = [...]
let target: [AnyDifferentiable] = [...]

And I get the StagedChangeset

let changes = StagedChangeset(source: oldItemsConverted, target: newItemsConverted)

How should I apply these changes to the source array to get the target array? What is the order of changes? Inserts first then moves or different order? Or should I sort the ChangeSet somehow?

I want to implement the element's sizes cache and need to apply all these changes to an array of sizes.

Environment

  • Library version: "1.3.0"

  • Swift version: 5.7

  • iOS version: any

  • Xcode version: 14.2

  • Devices/Simulators: any

  • CocoaPods/Carthage version: any

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

1 participant