diff --git a/CoreStoreDemo/CoreStoreDemo/AppDelegate.swift b/CoreStoreDemo/CoreStoreDemo/AppDelegate.swift index 73209b2..cae2352 100644 --- a/CoreStoreDemo/CoreStoreDemo/AppDelegate.swift +++ b/CoreStoreDemo/CoreStoreDemo/AppDelegate.swift @@ -7,8 +7,6 @@ // import UIKit -import CoreData -import CoreStore // MARK: - AppDelegate @@ -24,9 +22,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { application.statusBarStyle = .LightContent - print(CoreStore.beginUnsafe().commitAndWait()) - print(From("Config1", "Config2")) - return true } } diff --git a/Sources/Logging/CoreStore+CustomDebugStringConvertible.swift b/Sources/Logging/CoreStore+CustomDebugStringConvertible.swift index 5819bee..3a641f4 100644 --- a/Sources/Logging/CoreStore+CustomDebugStringConvertible.swift +++ b/Sources/Logging/CoreStore+CustomDebugStringConvertible.swift @@ -339,6 +339,46 @@ extension LegacySQLiteStore: CustomDebugStringConvertible, CoreStoreDebugStringC } +// MARK: - ListMonitor + +private struct CoreStoreFetchedSectionInfoWrapper: CoreStoreDebugStringConvertible { + + let sectionInfo: NSFetchedResultsSectionInfo + + var coreStoreDumpString: String { + + return createFormattedString( + "\"\(self.sectionInfo.name)\" (", ")", + ("numberOfObjects", self.sectionInfo.numberOfObjects), + ("indexTitle", self.sectionInfo.indexTitle) + ) + } +} + +extension ListMonitor: CustomDebugStringConvertible, CoreStoreDebugStringConvertible { + + // MARK: CustomDebugStringConvertible + + public var debugDescription: String { + + return formattedDebugDescription(self) + } + + + // MARK: CoreStoreDebugStringConvertible + + public var coreStoreDumpString: String { + + return createFormattedString( + "(", ")", + ("isPendingRefetch", self.isPendingRefetch), + ("numberOfObjects", self.numberOfObjects()), + ("sections", self.sections().map(CoreStoreFetchedSectionInfoWrapper.init)) + ) + } +} + + // MARK: - LocalStorageOptions extension LocalStorageOptions: CustomDebugStringConvertible, CoreStoreDebugStringConvertible { @@ -441,6 +481,96 @@ extension MigrationChain: CustomDebugStringConvertible, CoreStoreDebugStringConv } +// MARK: - MigrationType + +extension MigrationResult: CustomDebugStringConvertible, CoreStoreDebugStringConvertible { + + // MARK: CustomDebugStringConvertible + + public var debugDescription: String { + + return formattedDebugDescription(self) + } + + + // MARK: CoreStoreDebugStringConvertible + + public var coreStoreDumpString: String { + + switch self { + + case .Success(let migrationTypes): + return createFormattedString( + ".Success (", ")", + ("migrationTypes", migrationTypes) + ) + + case .Failure(let error): + return createFormattedString( + ".Failure (", ")", + ("error", error) + ) + } + } +} + + +// MARK: - MigrationType + +extension MigrationType: CustomDebugStringConvertible, CoreStoreDebugStringConvertible { + + // MARK: CustomDebugStringConvertible + + public var debugDescription: String { + + return formattedDebugDescription(self) + } + + + // MARK: CoreStoreDebugStringConvertible + + public var coreStoreDumpString: String { + + switch self { + + case .None(let version): + return ".None (\"\(version)\")" + + case .Lightweight(let sourceVersion, let destinationVersion): + return ".Lightweight (\"\(sourceVersion)\" → \"\(destinationVersion)\")" + + case .Heavyweight(let sourceVersion, let destinationVersion): + return ".Heavyweight (\"\(sourceVersion)\" → \"\(destinationVersion)\")" + } + } +} + + +// MARK: - ObjectMonitor + +extension ObjectMonitor: CustomDebugStringConvertible, CoreStoreDebugStringConvertible { + + // MARK: CustomDebugStringConvertible + + public var debugDescription: String { + + return formattedDebugDescription(self) + } + + + // MARK: CoreStoreDebugStringConvertible + + public var coreStoreDumpString: String { + + return createFormattedString( + "(", ")", + ("isObjectDeleted", self.isObjectDeleted), + ("object", self.object) + ) + } +} + + // MARK: - OrderBy extension OrderBy: CustomDebugStringConvertible, CoreStoreDebugStringConvertible { @@ -499,6 +629,30 @@ extension SaveResult: CustomDebugStringConvertible, CoreStoreDebugStringConverti } +// MARK: - SectionBy + +extension SectionBy: CustomDebugStringConvertible, CoreStoreDebugStringConvertible { + + // MARK: CustomDebugStringConvertible + + public var debugDescription: String { + + return formattedDebugDescription(self) + } + + + // MARK: CoreStoreDebugStringConvertible + + public var coreStoreDumpString: String { + + return createFormattedString( + "(", ")", + ("sectionKeyPath", self.sectionKeyPath) + ) + } +} + + // MARK: - Select extension Select: CustomDebugStringConvertible, CoreStoreDebugStringConvertible { @@ -567,6 +721,40 @@ extension SelectTerm: CustomDebugStringConvertible, CoreStoreDebugStringConverti } +// MARK: - SetupResult + +extension SetupResult: CustomDebugStringConvertible, CoreStoreDebugStringConvertible { + + // MARK: CustomDebugStringConvertible + + public var debugDescription: String { + + return formattedDebugDescription(self) + } + + + // MARK: CoreStoreDebugStringConvertible + + public var coreStoreDumpString: String { + + switch self { + + case .Success(let storage): + return createFormattedString( + ".Success (", ")", + ("storage", storage) + ) + + case .Failure(let error): + return createFormattedString( + ".Failure (", ")", + ("error", error) + ) + } + } +} + + // MARK: - SQLiteStore extension SQLiteStore: CustomDebugStringConvertible, CoreStoreDebugStringConvertible { @@ -828,7 +1016,7 @@ extension NSAttributeDescription: CoreStoreDebugStringConvertible { ("defaultValue", self.defaultValue), ("valueTransformerName", self.valueTransformerName), ("allowsExternalBinaryDataStorage", self.allowsExternalBinaryDataStorage), - ("entity", self.entity.name), + ("entity.name", self.entity.name), ("name", self.name), ("optional", self.optional), ("transient", self.transient), @@ -896,7 +1084,7 @@ extension NSEntityDescription: CoreStoreDebugStringConvertible { ("managedObjectClassName", self.managedObjectClassName!), ("name", self.name), ("abstract", self.abstract), - ("superentity", self.superentity?.name), + ("superentity?.name", self.superentity?.name), ("subentities", self.subentities.map({ $0.name })), ("properties", self.properties), ("userInfo", self.userInfo), @@ -929,19 +1117,6 @@ extension NSError: CoreStoreDebugStringConvertible { } } -extension NSManagedObject: CoreStoreDebugStringConvertible { - - public var coreStoreDumpString: String { - - // TODO: - var string = "(" - // string.appendDumpInfo("self", self) - string.indent(1) - string.appendContentsOf("\n)") - return string - } -} - extension NSManagedObjectModel: CoreStoreDebugStringConvertible { public var coreStoreDumpString: String { @@ -954,6 +1129,19 @@ extension NSManagedObjectModel: CoreStoreDebugStringConvertible { } } +extension NSManagedObjectID: CoreStoreDebugStringConvertible { + + public var coreStoreDumpString: String { + + return createFormattedString( + "\(self.URIRepresentation().coreStoreDumpString) (", ")", + ("entity.name", self.entity.name), + ("temporaryID", self.temporaryID), + ("persistentStore?.URL", self.persistentStore?.URL) + ) + } +} + extension NSMappingModel: CoreStoreDebugStringConvertible { public var coreStoreDumpString: String { @@ -976,14 +1164,14 @@ extension NSRelationshipDescription: CoreStoreDebugStringConvertible { return createFormattedString( "(", ")", - ("destinationEntity", self.destinationEntity?.name), - ("inverseRelationship", self.inverseRelationship?.name), + ("destinationEntity?.name", self.destinationEntity?.name), + ("inverseRelationship?.name", self.inverseRelationship?.name), ("minCount", self.minCount), ("maxCount", self.maxCount), ("deleteRule", self.deleteRule), ("toMany", self.toMany), ("ordered", self.ordered), - ("entity", self.entity.name), + ("entity.name", self.entity.name), ("name", self.name), ("optional", self.optional), ("transient", self.transient), diff --git a/Sources/ObjectiveC/CSAsynchronousDataTransaction.swift b/Sources/ObjectiveC/CSAsynchronousDataTransaction.swift index a4bd294..fdf5358 100644 --- a/Sources/ObjectiveC/CSAsynchronousDataTransaction.swift +++ b/Sources/ObjectiveC/CSAsynchronousDataTransaction.swift @@ -70,6 +70,14 @@ public final class CSAsynchronousDataTransaction: CSBaseDataTransaction { } + // MARK: NSObject + + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + + // MARK: BaseDataTransaction /** diff --git a/Sources/ObjectiveC/CSDataStack.swift b/Sources/ObjectiveC/CSDataStack.swift index 8b479e2..80dfc8f 100644 --- a/Sources/ObjectiveC/CSDataStack.swift +++ b/Sources/ObjectiveC/CSDataStack.swift @@ -253,6 +253,11 @@ public final class CSDataStack: NSObject, CoreStoreObjectiveCType { return self.bridgeToSwift === object.bridgeToSwift } + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + // MARK: CoreStoreObjectiveCType diff --git a/Sources/ObjectiveC/CSError.swift b/Sources/ObjectiveC/CSError.swift index ab8c543..45f7587 100644 --- a/Sources/ObjectiveC/CSError.swift +++ b/Sources/ObjectiveC/CSError.swift @@ -62,6 +62,11 @@ public final class CSError: NSError, CoreStoreObjectiveCType { return self.bridgeToSwift == object.bridgeToSwift } + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + // MARK: CoreStoreObjectiveCType diff --git a/Sources/ObjectiveC/CSFrom.swift b/Sources/ObjectiveC/CSFrom.swift index abe6ada..4c8b9af 100644 --- a/Sources/ObjectiveC/CSFrom.swift +++ b/Sources/ObjectiveC/CSFrom.swift @@ -111,6 +111,14 @@ public final class CSFrom: NSObject, CoreStoreObjectiveCType { } + // MARK: NSObject + + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + + // MARK: CoreStoreObjectiveCType public let bridgeToSwift: From diff --git a/Sources/ObjectiveC/CSGroupBy.swift b/Sources/ObjectiveC/CSGroupBy.swift index 031a570..e2f3634 100644 --- a/Sources/ObjectiveC/CSGroupBy.swift +++ b/Sources/ObjectiveC/CSGroupBy.swift @@ -66,6 +66,11 @@ public final class CSGroupBy: NSObject, CSQueryClause, CoreStoreObjectiveCType { return self.bridgeToSwift == object.bridgeToSwift } + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + // MARK: CSQueryClause diff --git a/Sources/ObjectiveC/CSInMemoryStore.swift b/Sources/ObjectiveC/CSInMemoryStore.swift index c092588..a7c7dcc 100644 --- a/Sources/ObjectiveC/CSInMemoryStore.swift +++ b/Sources/ObjectiveC/CSInMemoryStore.swift @@ -101,6 +101,11 @@ public final class CSInMemoryStore: NSObject, CSStorageInterface, CoreStoreObjec return self.bridgeToSwift === object.bridgeToSwift } + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + // MARK: CoreStoreObjectiveCType diff --git a/Sources/ObjectiveC/CSInto.swift b/Sources/ObjectiveC/CSInto.swift index b2ee480..f2e10c8 100644 --- a/Sources/ObjectiveC/CSInto.swift +++ b/Sources/ObjectiveC/CSInto.swift @@ -85,6 +85,11 @@ public final class CSInto: NSObject, CoreStoreObjectiveCType { return self.bridgeToSwift == object.bridgeToSwift } + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + // MARK: CoreStoreObjectiveCType diff --git a/Sources/ObjectiveC/CSListMonitor.swift b/Sources/ObjectiveC/CSListMonitor.swift index f142aac..5a83a73 100644 --- a/Sources/ObjectiveC/CSListMonitor.swift +++ b/Sources/ObjectiveC/CSListMonitor.swift @@ -537,6 +537,11 @@ public final class CSListMonitor: NSObject, CoreStoreObjectiveCType { return self.bridgeToSwift == object.bridgeToSwift } + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + // MARK: CoreStoreObjectiveCType diff --git a/Sources/ObjectiveC/CSMigrationResult.swift b/Sources/ObjectiveC/CSMigrationResult.swift index f9c2962..2fe7a36 100644 --- a/Sources/ObjectiveC/CSMigrationResult.swift +++ b/Sources/ObjectiveC/CSMigrationResult.swift @@ -153,6 +153,11 @@ public final class CSMigrationResult: NSObject, CoreStoreObjectiveCType { return self.bridgeToSwift == object.bridgeToSwift } + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + // MARK: CoreStoreObjectiveCType diff --git a/Sources/ObjectiveC/CSMigrationType.swift b/Sources/ObjectiveC/CSMigrationType.swift index 35b98ef..5d9afe8 100644 --- a/Sources/ObjectiveC/CSMigrationType.swift +++ b/Sources/ObjectiveC/CSMigrationType.swift @@ -99,6 +99,11 @@ public final class CSMigrationType: NSObject, CoreStoreObjectiveCType { return self.bridgeToSwift == object.bridgeToSwift } + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + // MARK: CoreStoreObjectiveCType diff --git a/Sources/ObjectiveC/CSObjectMonitor.swift b/Sources/ObjectiveC/CSObjectMonitor.swift index 5cb890b..72a3476 100644 --- a/Sources/ObjectiveC/CSObjectMonitor.swift +++ b/Sources/ObjectiveC/CSObjectMonitor.swift @@ -115,6 +115,11 @@ public final class CSObjectMonitor: NSObject, CoreStoreObjectiveCType { return self.bridgeToSwift == object.bridgeToSwift } + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + // MARK: CoreStoreObjectiveCType diff --git a/Sources/ObjectiveC/CSOrderBy.swift b/Sources/ObjectiveC/CSOrderBy.swift index 51ee2c7..56658fb 100644 --- a/Sources/ObjectiveC/CSOrderBy.swift +++ b/Sources/ObjectiveC/CSOrderBy.swift @@ -104,6 +104,11 @@ public final class CSOrderBy: NSObject, CSFetchClause, CSQueryClause, CSDeleteCl return self.bridgeToSwift == object.bridgeToSwift } + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + // MARK: CSFetchClause, CSQueryClause, CSDeleteClause diff --git a/Sources/ObjectiveC/CSSQliteStore.swift b/Sources/ObjectiveC/CSSQliteStore.swift index 061730c..1b0a76c 100644 --- a/Sources/ObjectiveC/CSSQliteStore.swift +++ b/Sources/ObjectiveC/CSSQliteStore.swift @@ -179,6 +179,11 @@ public final class CSSQLiteStore: NSObject, CSLocalStorage, CoreStoreObjectiveCT return self.bridgeToSwift === object.bridgeToSwift } + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + // MARK: CoreStoreObjectiveCType diff --git a/Sources/ObjectiveC/CSSaveResult.swift b/Sources/ObjectiveC/CSSaveResult.swift index a764de3..3337d65 100644 --- a/Sources/ObjectiveC/CSSaveResult.swift +++ b/Sources/ObjectiveC/CSSaveResult.swift @@ -153,6 +153,11 @@ public final class CSSaveResult: NSObject, CoreStoreObjectiveCType { return self.bridgeToSwift == object.bridgeToSwift } + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + // MARK: CoreStoreObjectiveCType diff --git a/Sources/ObjectiveC/CSSectionBy.swift b/Sources/ObjectiveC/CSSectionBy.swift index bd89f09..d7f9bcb 100644 --- a/Sources/ObjectiveC/CSSectionBy.swift +++ b/Sources/ObjectiveC/CSSectionBy.swift @@ -64,6 +64,14 @@ public final class CSSectionBy: NSObject, CoreStoreObjectiveCType { } + // MARK: NSObject + + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + + // MARK: CoreStoreObjectiveCType public let bridgeToSwift: SectionBy diff --git a/Sources/ObjectiveC/CSSelect.swift b/Sources/ObjectiveC/CSSelect.swift index 415e834..adae8d7 100644 --- a/Sources/ObjectiveC/CSSelect.swift +++ b/Sources/ObjectiveC/CSSelect.swift @@ -364,6 +364,11 @@ public final class CSSelect: NSObject { && self.selectTerms == object.selectTerms } + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + // MARK: CoreStoreObjectiveCType @@ -371,6 +376,7 @@ public final class CSSelect: NSObject { self.attributeType = T.attributeType self.selectTerms = swiftValue.selectTerms + self.bridgeToSwift = swiftValue super.init() } @@ -378,6 +384,7 @@ public final class CSSelect: NSObject { self.attributeType = .UndefinedAttributeType self.selectTerms = swiftValue.selectTerms + self.bridgeToSwift = swiftValue super.init() } @@ -386,6 +393,11 @@ public final class CSSelect: NSObject { internal let attributeType: NSAttributeType internal let selectTerms: [SelectTerm] + + + // MARK: Private + + private let bridgeToSwift: CoreStoreDebugStringConvertible } diff --git a/Sources/ObjectiveC/CSSetupResult.swift b/Sources/ObjectiveC/CSSetupResult.swift index d47914f..12d5ac8 100644 --- a/Sources/ObjectiveC/CSSetupResult.swift +++ b/Sources/ObjectiveC/CSSetupResult.swift @@ -56,7 +56,7 @@ public final class CSSetupResult: NSObject { } /** - A `CSStorageInterface` instance if the `commit` operation for the transaction succeeded. Returns `NO` otherwise. + A `CSStorageInterface` instance if the `commit` operation for the transaction succeeded. Returns `nil` otherwise. */ @objc public let storage: CSStorageInterface? @@ -143,6 +143,11 @@ public final class CSSetupResult: NSObject { return self.storage === object.storage && self.error == object.error } + + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } // MARK: CoreStoreObjectiveCType @@ -159,8 +164,14 @@ public final class CSSetupResult: NSObject { self.storage = nil self.error = error.bridgeToObjectiveC } + self.bridgeToSwift = swiftValue super.init() } + + + // MARK: Private + + private let bridgeToSwift: CoreStoreDebugStringConvertible } diff --git a/Sources/ObjectiveC/CSSynchronousDataTransaction.swift b/Sources/ObjectiveC/CSSynchronousDataTransaction.swift index 4da33be..cccb2d9 100644 --- a/Sources/ObjectiveC/CSSynchronousDataTransaction.swift +++ b/Sources/ObjectiveC/CSSynchronousDataTransaction.swift @@ -70,6 +70,14 @@ public final class CSSynchronousDataTransaction: CSBaseDataTransaction { } + // MARK: NSObject + + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + + // MARK: BaseDataTransaction /** diff --git a/Sources/ObjectiveC/CSTweak.swift b/Sources/ObjectiveC/CSTweak.swift index c867524..b41640b 100644 --- a/Sources/ObjectiveC/CSTweak.swift +++ b/Sources/ObjectiveC/CSTweak.swift @@ -50,6 +50,14 @@ public final class CSTweak: NSObject, CSFetchClause, CSQueryClause, CSDeleteClau } + // MARK: NSObject + + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + + // MARK: CSFetchClause, CSQueryClause, CSDeleteClause @objc diff --git a/Sources/ObjectiveC/CSUnsafeDataTransaction.swift b/Sources/ObjectiveC/CSUnsafeDataTransaction.swift index 2f0c5e7..48cebfc 100644 --- a/Sources/ObjectiveC/CSUnsafeDataTransaction.swift +++ b/Sources/ObjectiveC/CSUnsafeDataTransaction.swift @@ -138,6 +138,14 @@ public final class CSUnsafeDataTransaction: CSBaseDataTransaction { } + // MARK: NSObject + + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + + // MARK: CoreStoreObjectiveCType internal typealias SwiftType = UnsafeDataTransaction diff --git a/Sources/ObjectiveC/CSWhere.swift b/Sources/ObjectiveC/CSWhere.swift index d227164..56da078 100644 --- a/Sources/ObjectiveC/CSWhere.swift +++ b/Sources/ObjectiveC/CSWhere.swift @@ -117,6 +117,11 @@ public final class CSWhere: NSObject, CSFetchClause, CSQueryClause, CSDeleteClau return self.bridgeToSwift == object.bridgeToSwift } + public override var description: String { + + return "(\(String(reflecting: self.dynamicType))) \(self.bridgeToSwift.coreStoreDumpString)" + } + // MARK: CSFetchClause, CSQueryClause, CSDeleteClause diff --git a/Sources/Observing/ListMonitor.swift b/Sources/Observing/ListMonitor.swift index 7023ae1..a3d38da 100644 --- a/Sources/Observing/ListMonitor.swift +++ b/Sources/Observing/ListMonitor.swift @@ -1192,11 +1192,33 @@ public final class ListMonitor: Hashable { // MARK: - ListMonitor: Equatable @available(OSX, unavailable) -public func ==(lhs: ListMonitor, rhs: ListMonitor) -> Bool { +@warn_unused_result +public func == (lhs: ListMonitor, rhs: ListMonitor) -> Bool { return lhs === rhs } +@available(OSX, unavailable) +@warn_unused_result +public func == (lhs: ListMonitor, rhs: ListMonitor) -> Bool { + + return lhs.fetchedResultsController === rhs.fetchedResultsController +} + +@available(OSX, unavailable) +@warn_unused_result +public func ~= (lhs: ListMonitor, rhs: ListMonitor) -> Bool { + + return lhs === rhs +} + +@available(OSX, unavailable) +@warn_unused_result +public func ~= (lhs: ListMonitor, rhs: ListMonitor) -> Bool { + + return lhs.fetchedResultsController === rhs.fetchedResultsController +} + @available(OSX, unavailable) extension ListMonitor: Equatable { } @@ -1309,15 +1331,6 @@ extension ListMonitor: FetchedResultsControllerHandler { } -// MARK: - ListMonitor: Equatable - -@warn_unused_result -public func == (lhs: ListMonitor, rhs: ListMonitor) -> Bool { - - return lhs.fetchedResultsController === rhs.fetchedResultsController -} - - // MARK: - Notification Keys private let ListMonitorWillChangeListNotification = "ListMonitorWillChangeListNotification" diff --git a/Sources/Observing/ObjectMonitor.swift b/Sources/Observing/ObjectMonitor.swift index 2914aac..fc61246 100644 --- a/Sources/Observing/ObjectMonitor.swift +++ b/Sources/Observing/ObjectMonitor.swift @@ -301,7 +301,13 @@ public final class ObjectMonitor { // MARK: - ObjectMonitor: Equatable @available(OSX, unavailable) -public func ==(lhs: ObjectMonitor, rhs: ObjectMonitor) -> Bool { +public func == (lhs: ObjectMonitor, rhs: ObjectMonitor) -> Bool { + + return lhs === rhs +} + +@available(OSX, unavailable) +public func ~= (lhs: ObjectMonitor, rhs: ObjectMonitor) -> Bool { return lhs === rhs }