Skip to content

Commit

Permalink
Show a warning if a transformer is not registered
Browse files Browse the repository at this point in the history
For named transformers.
  • Loading branch information
helje5 committed Feb 16, 2024
1 parent f4f8461 commit 5457203
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 5457203

Please sign in to comment.