Instance Method

keysSortedByValue(comparator:)

Returns an array of the dictionary’s keys, in the order they would be in if the dictionary were sorted by its values using a given comparator block.

Declaration

func keysSortedByValue(comparator cmptr: (Any, Any) -> ComparisonResult) -> [Any]

Parameters

cmptr

A comparator block.

Return Value

An array of the dictionary’s keys, in the order they would be in if the dictionary were sorted by its values using cmptr.

See Also

Sorting Dictionaries

func keysSortedByValue(using: Selector) -> [Any]

Returns an array of the dictionary’s keys, in the order they would be in if the dictionary were sorted by its values.

func keysSortedByValue(options: NSSortOptions, usingComparator: (Any, Any) -> ComparisonResult) -> [Any]

Returns an array of the dictionary’s keys, in the order they would be in if the dictionary were sorted by its values using a given comparator block and a specified set of options.