Generic Initializer

init(keyPath:ascending:comparator:)

Creates a sort descriptor with a specified key path and ordering, and a comparator block.

Declaration 宣言

convenience init<Root, Value>(keyPath: KeyPath<Root, Value>, ascending: Bool, comparator cmptr: @escaping Comparator)

Parameters パラメータ

keyPath

The key path to the property to compare.

ascending

If true, the sort descriptor compares using the SortOrder.forward sort order; otherwise, it uses SortOrder.reverse.

cmptr

A comparator block. 比較を行うブロック。

See Also 参照

Creating a Sort Descriptor ソート記述子を作成する