Order

public struct Order : Codable

A structure that defines an ordering to be applied when returning a list of results.

  • The field to that the order should be applied to.

    Declaration

    Swift

    public let field: String
  • The direction of the sort order.

    Declaration

    Swift

    public let direction: Direction
  • Options for defining the direction of the sort order.

    See more

    Declaration

    Swift

    public enum Direction : String, Codable

Defining order

  • Defines an Order that indicates sorting by the given field, in ascending order.

    Declaration

    Swift

    public static func ascending(_ field: String) -> Order

    Parameters

    field

    The field to sort by.

  • Defines an Order that indicates sorting by the given field, in descending order.

    Declaration

    Swift

    public static func descending(_ field: String) -> Order

    Parameters

    field

    The field to sort by.