SortDescriptor
public struct 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
SortDescriptorwith the given property and ascending values.Declaration
Swift
public init(property: String, ascending: Bool = true)Parameters
propertyThe name of the property which this sort descriptor orders results by.
ascendingWhether this descriptor sorts in ascending or descending order.
-
Returns a copy of the
SortDescriptorwith the sort order reversed.Declaration
Swift
public func reversed() -> SortDescriptor
-
Returns a human-readable description of the sort descriptor.
Declaration
Swift
public var description: String
-
Creates a
SortDescriptorfrom aUnicodeScalarLiteralType.Declaration
Swift
public init(unicodeScalarLiteral value: UnicodeScalarLiteralType)Parameters
unicodeScalarLiteralProperty name literal.
-
Creates a
SortDescriptorfrom anExtendedGraphemeClusterLiteralType.Declaration
Swift
public init(extendedGraphemeClusterLiteral value: ExtendedGraphemeClusterLiteralType)Parameters
extendedGraphemeClusterLiteralProperty name literal.
-
Creates a
SortDescriptorfrom aStringLiteralType.Declaration
Swift
public init(stringLiteral value: StringLiteralType)Parameters
stringLiteralProperty name literal.
View on GitHub
Install in Dash
SortDescriptor Struct Reference