init(_:)
Creates a new collection difference from a collection of changes.
Declaration
init?<Changes>(_ changes: Changes) where Changes : Collection, Changes.Element == CollectionDifference<ChangeElement>.ChangeParameters
- changes:
A collection of changes that represent a transition between two states.
Discussion
To find the difference between two collections, use the difference(from:) method declared on the BidirectionalCollection protocol.
The collection of changes passed as changes must meet these requirements:
All insertion offsets are unique
All removal offsets are unique
All associations between insertions and removals are symmetric