Comparable

protocol Comparable : Equatable
  • Sorts two values.

    Declaration

    Swift

    static func sort(_ a: Self, _ b: Self) -> (Self, Self)

    Parameters

    a

    1st value.

    b

    2nd value.

    Return Value

    A tuple with the two values sorted.

  • Gets the maximum of two values.

    Declaration

    Swift

    static func max(_ a: Self, _ b: Self) -> Self

    Parameters

    a

    1st value.

    b

    2nd value.

    Return Value

    Maximum of both values.

  • Gets the minimum of two values.

    Declaration

    Swift

    static func min(_ a: Self, _ b: Self) -> Self

    Parameters

    a

    1st value.

    b

    2nd value.

    Return Value

    Minimum of both values.