diff --git a/MVMCore/MVMCore/Models/Model/ModelProtocol.swift b/MVMCore/MVMCore/Models/Model/ModelProtocol.swift index cdabef2..ed9f5cf 100644 --- a/MVMCore/MVMCore/Models/Model/ModelProtocol.swift +++ b/MVMCore/MVMCore/Models/Model/ModelProtocol.swift @@ -52,7 +52,7 @@ extension ModelProtocol { } public protocol ModelComparisonProtocol { - /// Deep checks if the curent model is equal to another model. Defaults to false unless implemented otherwise. + /// Shallow checks if the curent model is equal to another model. Defaults to false unless implemented otherwise. func isEqual(to model: ModelComparisonProtocol) -> Bool } @@ -97,3 +97,15 @@ public extension Optional where Wrapped: Collection { return self.isEqual(to: models) } } + +public extension Optional { + /// Checks if + func matchExistence(with anotherOptional: Optional) -> Bool { + switch(self) { + case .none: + return anotherOptional == nil + case .some(_): + return anotherOptional != nil + } + } +} diff --git a/MVMCore/MVMCore/Models/Model/ModelRegistry.swift b/MVMCore/MVMCore/Models/Model/ModelRegistry.swift index dbb2afa..bd9f721 100644 --- a/MVMCore/MVMCore/Models/Model/ModelRegistry.swift +++ b/MVMCore/MVMCore/Models/Model/ModelRegistry.swift @@ -105,7 +105,7 @@ public struct ModelRegistry { MVMCoreLoggingHandler.shared()?.addError(toLog: errorObject) #if DEBUG - triggerCrashInDebug() + //triggerCrashInDebug() #endif }