From 54572030a422188a1d36acc9190f756737990ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helge=20He=C3=9F?= Date: Fri, 16 Feb 2024 14:49:02 +0100 Subject: [PATCH] Show a warning if a transformer is not registered For named transformers. --- .../SchemaCompatibility/NSAttributeDescription+Data.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/ManagedModels/SchemaCompatibility/NSAttributeDescription+Data.swift b/Sources/ManagedModels/SchemaCompatibility/NSAttributeDescription+Data.swift index 162efbd..6e7f240 100644 --- a/Sources/ManagedModels/SchemaCompatibility/NSAttributeDescription+Data.swift +++ b/Sources/ManagedModels/SchemaCompatibility/NSAttributeDescription+Data.swift @@ -209,6 +209,10 @@ private extension NSAttributeDescription { assert(valueTransformerName == nil) attributeType = .transformableAttributeType valueTransformerName = name + if !ValueTransformer.valueTransformerNames().contains(.init(name)) { + print("WARNING: Named transformer is not registered: \(name)", + "in attribute:", self) + } case .transformableByType(let type): let name = NSStringFromClass(type) if !ValueTransformer.valueTransformerNames().contains(.init(name)) {