sorted(by:)
func sorted<S: Sequence>(by sortDescriptors: S) -> Results<ElementType> where S.Iterator.Element == SortDescriptor
Returns a Results
containing the objects in the collection, but sorted.
Warning
Collections may only be sorted by properties of boolean, Date
, NSDate
, single and double-precision
floating point, integer, and string types.
-
Declaration
Swift
func sorted<S: Sequence>(by sortDescriptors: S) -> Results<ElementType> where S.Iterator.Element == SortDescriptor