RLMSortDescriptor
@interface RLMSortDescriptor : NSObject
An RLMSortDescriptor stores a property name and a sort order for use with
sortedResultsUsingDescriptors:
. It is similar to NSSortDescriptor, but supports
only the subset of functionality which can be efficiently run by the query
engine. RLMSortDescriptor instances are immutable.
-
The name of the property which this sort descriptor orders results by.
Declaration
Objective‑C
@property (readonly, nonatomic) NSString *_Nonnull property;
Swift
var property: String { get }
-
Whether this descriptor sorts in ascending or descending order.
Declaration
Objective‑C
@property (readonly, nonatomic) BOOL ascending;
Swift
var ascending: Bool { get }
-
Returns a new sort descriptor for the given property name and order.
Declaration
Objective‑C
+ (nonnull instancetype)sortDescriptorWithProperty: (nonnull NSString *)propertyName ascending:(BOOL)ascending;
Swift
convenience init(property propertyName: String, ascending: Bool)
-
Returns a copy of the receiver with the sort order reversed.
Declaration
Objective‑C
- (nonnull instancetype)reversedSortDescriptor;
Swift
func reversedSortDescriptor() -> Self