sorted(using:)
Returns the elements of the sequence, sorted using the given comparator to compare elements.
Declaration
func sorted<Comparator>(using comparator: Comparator) -> [Self.Element] where Comparator : SortComparator, Self.Element == Comparator.ComparedParameters
- comparator:
The comparator to use in ordering elements
Return Value
An array of the elements sorted using comparator.