WIP: objective-C fetching

This commit is contained in:
John Rommel Estropia
2016-03-27 23:02:24 +09:00
parent 789028bc58
commit b8ea7ecf01
26 changed files with 1939 additions and 198 deletions
@@ -67,7 +67,7 @@ public enum SortKey {
/**
The `OrderBy` clause specifies the sort order for results for a fetch or a query.
*/
public struct OrderBy: FetchClause, QueryClause, DeleteClause {
public struct OrderBy: FetchClause, QueryClause, DeleteClause, Hashable {
/**
Initializes a `OrderBy` clause with a list of sort descriptors
@@ -147,4 +147,21 @@ public struct OrderBy: FetchClause, QueryClause, DeleteClause {
fetchRequest.sortDescriptors = self.sortDescriptors
}
// MARK: Hashable
public var hashValue: Int {
return (self.sortDescriptors as NSArray).hashValue
}
}
// MARK: - OrderBy: Equatable
@warn_unused_result
public func == (lhs: OrderBy, rhs: OrderBy) -> Bool {
return lhs.sortDescriptors == rhs.sortDescriptors
}