Contents

keysSortedByValue(options:usingComparator:)

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.

Declaration

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

Parameters

  • opts:

    A bitmask of sort options.

  • 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 with the options given in opts.

See Also

Sorting Dictionaries