Instance Methodswift 6.0.3Swift
index(before:)
- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
func index(before index: CollectionDifference<ChangeElement>.Index) -> CollectionDifference<ChangeElement>.Index
func index(before index: CollectionDifference<ChangeElement>.Index) -> CollectionDifference<ChangeElement>.Index
ss20CollectionDifferenceV5index6beforeAB5IndexVyx_GAG_tF
What are these?3ZEYP
import Swift
struct CollectionDifference<ChangeElement>
A collection of insertions and removals that describe the difference between two ordered collection states.
@frozen struct Index
The position of a collection difference.
init?<Changes>(_ changes: Changes) where Changes : Collection, Changes.Element == CollectionDifference<ChangeElement>.Change
Creates a new collection difference from a collection of changes.
var endIndex: CollectionDifference<ChangeElement>.Index { get }
let insertions: [CollectionDifference<ChangeElement>.Change]
The insertions contained by this difference, from lowest offset to highest.
let removals: [CollectionDifference<ChangeElement>.Change]
The removals contained by this difference, from lowest offset to highest.
var startIndex: CollectionDifference<ChangeElement>.Index { get }
subscript(position: CollectionDifference<ChangeElement>.Index) -> CollectionDifference<ChangeElement>.Element { get }
func distance(from start: CollectionDifference<ChangeElement>.Index, to end: CollectionDifference<ChangeElement>.Index) -> Int
func formIndex(_ index: inout CollectionDifference<ChangeElement>.Index, offsetBy distance: Int)
func index(after index: CollectionDifference<ChangeElement>.Index) -> CollectionDifference<ChangeElement>.Index
func inverse() -> CollectionDifference<ChangeElement>
@frozen enum Change
A single change to a collection.
typealias Element = CollectionDifference<ChangeElement>.Change