Enumeration
ComparisonResult
iOS 2.0+
iPadOS 2.0+
Mac Catalyst 2.0+
macOS 10.0+
tvOS 9.0+
watchOS 2.0+
Constants that indicate sort order.
@frozen enum ComparisonResult
Overview
These constants are 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:
func f(a: Int, b: Int) -> ComparisonResult
If: a < b then return .orderedAscending. The left operand is smaller than the right operand. a > b then return .orderedDescending. The left operand is greater than the right operand. a == b then return .orderedSame. The operands are equal.
Topics
Enumeration Cases
case orderedAscendingThe left operand is smaller than the right operand.case orderedDescendingThe left operand is greater than the right operand.case orderedSameThe two operands are equal.
Initializers
Default Implementations
Relationships
Conforms To
Swift.BitwiseCopyableSwift.CopyableSwift.DecodableSwift.EncodableSwift.EquatableSwift.EscapableSwift.HashableSwift.RawRepresentableSwift.SendableSwift.SendableMetatype