Skip to content

How to apply ChageSet to an array? #156

Description

@Aranoledur

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions