# CSOrderBy Class Reference

# CSOrderBy

    @objc
    public final class CSOrderBy : NSObject, CSFetchClause, CSQueryClause, CSDeleteClause

The `CSOrderBy` serves as the Objective-C bridging type for `OrderBy`.

See also

`OrderBy`

- `sortDescriptors`

  The list of sort descriptors

  #### Declaration

  Swift

      @objc
      public var sortDescriptors: [NSSortDescriptor] { get }

- `init(sortDescriptor:)`

  Initializes a `CSOrderBy` clause with a single sort descriptor

      MyPersonEntity *people = [transaction
         fetchAllFrom:CSFromClass([MyPersonEntity class])
         fetchClauses:@[CSOrderByKey(CSSortAscending(@"fullname"))]]];

  #### Declaration

  Swift

      @objc
      public convenience init(sortDescriptor: NSSortDescriptor)

  #### Parameters

  `sortDescriptor` | a `NSSortDescriptor`

- `init(sortDescriptors:)`

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

      MyPersonEntity *people = [transaction
         fetchAllFrom:CSFromClass([MyPersonEntity class])
         fetchClauses:@[CSOrderByKeys(CSSortAscending(@"fullname"), CSSortDescending(@"age"), nil))]]];

  #### Declaration

  Swift

      @objc
      public convenience init(sortDescriptors: [NSSortDescriptor])

  #### Parameters

  `sortDescriptors` | an array of `NSSortDescriptor`s