Inherits from NSObject
Declared in TKDataSourceSortDescriptor.h

Overview

A sort descriptor that is used in TKDataSource to sort items.

Properties

ascending

Defines the sort direction. Ignored when using a comparator function.

@property (nonatomic, assign) BOOL ascending

Declared In

TKDataSourceSortDescriptor.h

comparator

A comparison block function that is used to sort items. This property has higher priority than the propertyName.

@property (readonly, nullable) NSComparator comparator

Declared In

TKDataSourceSortDescriptor.h

descriptor

Returns an instance of NSSortDescriptor based on the settings of the group descriptor.

@property (nonatomic, strong, readonly, nonnull) NSSortDescriptor *descriptor

Declared In

TKDataSourceSortDescriptor.h

propertyName

The name of the property by which values sorted. The name of this property is ignored when the comparator property is set.

@property (nonatomic, copy, nullable) NSString *propertyName

Declared In

TKDataSourceSortDescriptor.h

Instance Methods

initWithComparator:

Initializes the sort descriptor with a comparator.

- (instancetype __nonnull)initWithComparator:(NSComparator __nonnull)comparator

Parameters

comparator

The comparator function to use when sorting items.

Declared In

TKDataSourceSortDescriptor.h

initWithProperty:ascending:

Initializes the sort descriptor with a property name and sort direction.

- (instancetype __nonnull)initWithProperty:(NSString *__nonnull)propertyName ascending:(BOOL)ascending

Parameters

propertyName

The name of the property that is sorted.

ascending

The sort direction.

Declared In

TKDataSourceSortDescriptor.h