sorted(by:)
public func sorted<S: Sequence>(by sortDescriptors: S) -> Results<Element>
where S.Iterator.Element == SortDescriptor
Returns a Results
containing the objects represented by the results, 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
public func sorted<S: Sequence>(by sortDescriptors: S) -> Results<Element> where S.Iterator.Element == SortDescriptor