SortDescriptor
A SortDescriptor
stores a property name and a sort order for use with
sorted(sortDescriptors:)
. It is similar to NSSortDescriptor
, but supports
only the subset of functionality which can be efficiently run by Realm’s query
engine.
-
The name of the property which this sort descriptor orders results by.
Declaration
Swift
public let property: String
-
Whether this descriptor sorts in ascending or descending order.
Declaration
Swift
public let ascending: Bool
-
Creates a
SortDescriptor
with the given property and ascending values.Declaration
Swift
public init(property: String, ascending: Bool = true)
-
Returns a copy of the receiver with the sort order reversed.
Declaration
Swift
public func reversed() -> SortDescriptor