# OrderBy

    public struct OrderBy<O> : OrderByClause, FetchClause, QueryClause, DeleteClause, Hashable where O : DynamicObject

    extension OrderBy: CustomDebugStringConvertible, CoreStoreDebugStringConvertible

The `OrderBy` clause specifies the sort order for results for a fetch or a query.

- `+(_:_:)`

  Combines two `OrderBy` sort descriptors together

  #### Declaration

  Swift

      public static func + (left: OrderBy, right: OrderBy) -> OrderBy

- `+=(_:_:)`

  Combines two `OrderBy` sort descriptors together and stores the result to the left operand

  #### Declaration

  Swift

      public static func += (left: inout OrderBy, right: OrderBy)

- `init()`

  Initializes a `OrderBy` clause with an empty list of sort descriptors

  #### Declaration

  Swift

      public init()

- `init(_:)`

  Initializes a `OrderBy` clause with a single sort descriptor

  #### Declaration

  Swift

      public init(_ sortDescriptor: NSSortDescriptor)

  #### Parameters

  `sortDescriptor` | a `NSSortDescriptor`

- `init(_:)`

  Initializes a `OrderBy` clause with a list of sort descriptors

  #### Declaration

  Swift

      public init(_ sortDescriptors: [NSSortDescriptor])

  #### Parameters

  `sortDescriptors` | a series of `NSSortDescriptor`s

- `init(_:)`

  Initializes a `OrderBy` clause with a series of `SortKey`s

  #### Declaration

  Swift

      public init(_ sortKeys: [SortKey])

  #### Parameters

  `sortKey` | a series of `SortKey`s

- `init(_:_:)`

  Initializes a `OrderBy` clause with a series of `SortKey`s

  #### Declaration

  Swift

      public init(_ sortKey: SortKey, _ sortKeys: SortKey...)

  #### Parameters

  `sortKey` | a single `SortKey`
  `sortKeys` | a series of `SortKey`s

### OrderByClause

- `ObjectType`

  #### Declaration

  Swift

      public typealias ObjectType = O

- `sortDescriptors`

  #### Declaration

  Swift

      public let sortDescriptors: [NSSortDescriptor]

### Equatable

- `==(_:_:)`

  #### Declaration

  Swift

      public static func == (lhs: OrderBy, rhs: OrderBy) -> Bool

### Hashable

- `hash(into:)`

  #### Declaration

  Swift

      public func hash(into hasher: inout Hasher)

### SortKey

- `SortKey`

  The `SortKey` is passed to the `OrderBy` clause to indicate the sort keys and their sort direction.

  See more

  #### Declaration

  Swift

      public struct SortKey

### CustomDebugStringConvertible

- `debugDescription`

  #### Declaration

  Swift

      public var debugDescription: String { get }