QuerySortInput
public struct QuerySortInput
-
Declaration
Swift
public let inputs: [QuerySortBy] -
Declaration
Swift
public init(_ inputs: [QuerySortBy]) -
Creates a
QuerySortInputin an expressive way, enabling a short and developer friendly access to an instance ofQuerySortInput. Simply by calling:- Amplify.Datastore.query(model.self, sort: .ascending(model.keys.id)) or
- Amplify.Datastore.query(model.self, sort: .descending(model.keys.id)) or
Amplify.Datastore.query(model.self, sort: .by(.ascending(model.keys.id), .descending(model.keys.createdAt))
Declaration
Swift
public static func by(_ inputs: QuerySortBy...) -> QuerySortInputParameters
inputsa variadic parameters that take uncertain number of
QuerySortByReturn Value
a new instance of
QuerySortInput -
Returns an ascending sort specifier for
fieldDeclaration
Swift
public static func ascending(_ field: CodingKey) -> QuerySortInput -
Returns an descending sort specifier for
fieldDeclaration
Swift
public static func descending(_ field: CodingKey) -> QuerySortInput
View on GitHub