Changeset
public struct Changeset<Collection> where Collection : Collection
A set of changes in the sectioned collection.
Changes to the section of the linear collection should be empty.
Notice that the value of the changes represents offsets of collection not index.
Since offsets are unordered, order is ignored when comparing two Changeset
s.
-
The collection after changed.
Declaration
Swift
public var data: Collection
-
The offsets of deleted sections.
Declaration
Swift
public var sectionDeleted: [Int]
-
The offsets of inserted sections.
Declaration
Swift
public var sectionInserted: [Int]
-
The offsets of updated sections.
Declaration
Swift
public var sectionUpdated: [Int]
-
The pairs of source and target offset of moved sections.
Declaration
Swift
public var sectionMoved: [(source: Int, target: Int)]
-
The paths of deleted elements.
Declaration
Swift
public var elementDeleted: [ElementPath]
-
The paths of inserted elements.
Declaration
Swift
public var elementInserted: [ElementPath]
-
The paths of updated elements.
Declaration
Swift
public var elementUpdated: [ElementPath]
-
The pairs of source and target path of moved elements.
Declaration
Swift
public var elementMoved: [(source: ElementPath, target: ElementPath)]
-
The number of all changes.
Declaration
Swift
public var changeCount: Int { get }
-
A Boolean value indicating whether has changes.
Declaration
Swift
public var hasChanges: Bool { get }
-
init(data:sectionDeleted:sectionInserted:sectionUpdated:sectionMoved:elementDeleted:elementInserted:elementUpdated:elementMoved:)
Creates a new
Changeset
.Declaration
Swift
public init( data: Collection, sectionDeleted: [Int] = [], sectionInserted: [Int] = [], sectionUpdated: [Int] = [], sectionMoved: [(source: Int, target: Int)] = [], elementDeleted: [ElementPath] = [], elementInserted: [ElementPath] = [], elementUpdated: [ElementPath] = [], elementMoved: [(source: ElementPath, target: ElementPath)] = [] )
Parameters
data
The collection after changed.
sectionDeleted
The offsets of deleted sections.
sectionInserted
The offsets of inserted sections.
sectionUpdated
The offsets of updated sections.
sectionMoved
The pairs of source and target offset of moved sections.
elementDeleted
The paths of deleted elements.
elementInserted
The paths of inserted elements.
elementUpdated
The paths of updated elements.
elementMoved
The pairs of source and target path of moved elements.
-
Declaration
Swift
public static func == (lhs: Changeset, rhs: Changeset) -> Bool
-
Declaration
Swift
public var debugDescription: String { get }