modo-studio / SugarRecord

CoreData/Realm sweet wrapper written in Swift
MIT License
2.11k stars 223 forks source link

support sortDescriptors #318

Closed linxu1231 closed 7 years ago

linxu1231 commented 7 years ago

What

NSSortDescriptor Array is not supported.

Context

fetchRequest.sortDescriptors = [sortDescriptor1, sortDescriptor2]

Proposal

public func sorted(with sortDescriptors: [NSSortDescriptor]) -> FetchRequest<T> {
    return self
        .request(withSortDescriptors: sortDescriptors)
}