allow equality comparison on ListMonitor and ObjectMonitor to help distinguish senders when observing multiple monitors

This commit is contained in:
John Estropia
2015-08-20 14:25:14 +09:00
parent 3348aa0bef
commit 71477c0839
2 changed files with 20 additions and 0 deletions

View File

@@ -729,6 +729,16 @@ public final class ListMonitor<T: NSManagedObject> {
}
// MARK: - ListMonitor: Equatable
public func ==<T: NSManagedObject>(lhs: ListMonitor<T>, rhs: ListMonitor<T>) -> Bool {
return lhs === rhs
}
extension ListMonitor: Equatable { }
// MARK: - ListMonitor: FetchedResultsControllerHandler
extension ListMonitor: FetchedResultsControllerHandler {

View File

@@ -261,6 +261,16 @@ public final class ObjectMonitor<T: NSManagedObject> {
}
// MARK: - ObjectMonitor: Equatable
public func ==<T: NSManagedObject>(lhs: ObjectMonitor<T>, rhs: ObjectMonitor<T>) -> Bool {
return lhs === rhs
}
extension ObjectMonitor: Equatable { }
// MARK: - ObjectMonitor: FetchedResultsControllerHandler
extension ObjectMonitor: FetchedResultsControllerHandler {