Post

Replies

Boosts

Views

Activity

Reply to SwiftData error: NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release
This is still an issue for me in Xcode 15 RC. Below is an example of the transformer I'm using for saving a UIColor final class ColorValueTransformer: NSSecureUnarchiveFromDataTransformer { static let name = NSValueTransformerName(rawValue: String(describing: ColorValueTransformer.self)) override static var allowedTopLevelClasses: [AnyClass] { return [UIColor.self] } public static func register() { let transformer = ColorValueTransformer() ValueTransformer.setValueTransformer(transformer, forName: name) } }
Sep ’23
Reply to SwiftData error: NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release
This is still an issue for me in Xcode 15 RC. Below is an example of the transformer I'm using for saving a UIColor final class ColorValueTransformer: NSSecureUnarchiveFromDataTransformer { static let name = NSValueTransformerName(rawValue: String(describing: ColorValueTransformer.self)) override static var allowedTopLevelClasses: [AnyClass] { return [UIColor.self] } public static func register() { let transformer = ColorValueTransformer() ValueTransformer.setValueTransformer(transformer, forName: name) } }
Replies
Boosts
Views
Activity
Sep ’23
Reply to No "upsert" when working with .unique attributes
I've also come across this issue too
Replies
Boosts
Views
Activity
Jun ’23
Reply to SwiftData Crash On Models With Relationships Deletion
If you mark the properties in Category as optional then it works fine with no crashes. But then you don't get uniqueness and you're able to insert duplicates into the context.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’23