Instance Methodswift 6.0.3FoundationInternationalization
compare(_:_:)
- iOS
- 15.0+
- macOS
- 12.0+
- tvOS
- 15.0+
- watchOS
- 8.0+
func compare(_ lhs: Compared, _ rhs: Compared) -> ComparisonResult
func compare(_ lhs: Compared, _ rhs: Compared) -> ComparisonResult
s30FoundationInternationalization14SortDescriptorV7comparey0A10Essentials16ComparisonResultOx_xtF
What are these?1BWCJ
import FoundationInternationalization
struct SortDescriptor<Compared>
A serializable description of how to sort numeric and String
types.
@frozen enum ComparisonResult
Used to indicate how items in a request are ordered, from the first one given in a method invocation or function call to the last (that is, left to right in code). Given the function:
init(_ keyPath: any KeyPath<Compared, String> & Sendable, comparator: String.StandardComparator)
Temporarily available as a replacement for init(_:comparator:)
with a default argument.
init(_ keyPath: any KeyPath<Compared, String?> & Sendable, comparator: String.StandardComparator)
Temporarily available as a replacement for init(_:comparator:)
with a default argument.
init(_ keyPath: any KeyPath<Compared, String> & Sendable, comparator: String.StandardComparator, order: SortOrder)
Temporarily available as a replacement for init(_:comparator:)
with a default argument.
init(_ keyPath: any KeyPath<Compared, String?> & Sendable, comparator: String.StandardComparator, order: SortOrder)
Temporarily available as a replacement for init(_:comparator:)
with a default argument.
init<Value>(_ keyPath: any KeyPath<Compared, Value> & Sendable, order: SortOrder = .forward) where Value : Comparable
init<Value>(_ keyPath: any KeyPath<Compared, Value?> & Sendable, order: SortOrder = .forward) where Value : Comparable
init(from decoder: any Decoder) throws
var keyPath: PartialKeyPath<Compared>? { get }
The key path to the field for comparison.
var order: SortOrder
Sort order.
var stringComparator: String.StandardComparator? { get }
A String.StandardComparator
value.
func hash(into hasher: inout Hasher)