Structure
SortDescriptor
iOS 15.0+
iPadOS 15.0+
Mac Catalyst 15.0+
macOS 12.0+
tvOS 15.0+
watchOS 8.0+
A serializable description of how to sort numerics and strings.
struct SortDescriptor<Compared>
Topics
Initializers
init(_:comparator:)Temporarily available as a replacement forinit(_:comparator:)with a default argument.init(_:comparator:order:)Temporarily available as a replacement forinit(_:comparator:)with a default argument.init(_:order:)init(from: any Decoder) throws
Instance Properties
var keyPath: PartialKeyPath<Compared>?The key path to the field for comparison.var order: SortOrderThe sort order that the sort descriptor uses to compare.var stringComparator: String.StandardComparator?AString.StandardComparatorvalue.
Instance Methods
func compare(Compared, Compared) -> ComparisonResultProvides the relative ordering of two elements.func hash(into: inout Hasher)
Relationships
Conforms To
SortComparatorSwift.DecodableSwift.EncodableSwift.EquatableSwift.HashableSwift.SendableSwift.SendableMetatype