Limitations for attributes in SwiftData models?

Hi,

is there any description/documentation about what can not be used as SwiftData attributes?

I do not mean things which cause issues at compile time, like having a type which is not Codeable. But rather I am looking for info which things to avoid, if you do not want to run into application crashes in modelContext.save(). Like for example having an enum which as an optional associated value as an attribute type (crashes on save is the associated value is nil).

Anybody seen any documentation about that? Or tech notes?

Thanks in advance for any hints :-).

Cheers, Michael

I wish. On a closely related topic, I put in FB15164782 asking for documentation on how SwiftData encodes/decodes struct-valued attributes, but yes, more general documentation would help. And better runtime diagnostics. Adding iCloud support to a store further limits the attribute types allowed.

Limitations for attributes in SwiftData models?
 
 
Q