Instance Method

sortedArray(using:)

Returns an array of the ordered set’s elements sorted as specified by a given array of sort descriptors.

Declaration

func sortedArray(using sortDescriptors: [NSSortDescriptor]) -> [Any]

Parameters

sortDescriptors

An array of NSSortDescriptor objects.

Return Value

An NSArray containing the ordered set’s elements sorted as specified by sortDescriptors.

Discussion

The first descriptor specifies the primary key path to be used in sorting the ordered set’s elements. Any subsequent descriptors are used to further refine sorting of objects with duplicate values. See NSSortDescriptor for additional information.

See Also

Creating a Sorted Array

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

Returns an array that lists the receiving ordered set’s elements in ascending order, as determined by the comparison method specified by a given NSComparator block

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

Returns an array that lists the receiving ordered set’s elements in ascending order, as determined by the comparison method specified by a given NSComparator block.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software