I'm trying out SwiftData and converting my existing data models using Structs and Codable to Classes and SwiftData. I've got a model that has a Measurement<UnitMass>
type. When I run the app after converting everything to use classes with the @Model
macro, I get a fatal error: SwiftData/SchemaProperty.swift:325: Fatal error: Unexpected type for CompositeAttribute: NSUnitMass
.
Since Measurement
conforms to Codable
, and SwiftData should work with Codable
types, why is this not working?
I also tried marking the property with @Attribute(.transformable)
and it didn't make a difference.