Does SwiftData not allow model class inheritance?

Just for grins, I tried running the SwiftData generation tool on the existing Core Data model of a non-trivial app I've worked on for a decade or so. It's pretty substantial, and uses some more advanced features, so it seemed like an interesting test case.

One of the warnings that was not reported by the UI, but which showed up in the generated code was quite a few instances of this:

Entity inheritance on entity Bar (parent class Foo) is unsupported in SwiftData.

Now that I'm looking at the code examples more carefully, I see an awful lot of final class, which maybe should have raised a red flag sooner. But to the best of my recollection, none of the sessions outright said that inheritance (was or) was not supported. Core Data has supported this functionality for a long time (maybe since the beginning).

Assuming that this isn't supported in this first seed, are there plans to provide this functionality in the future? By the launch of iOS 17?

(For the record, this model has 93 entities, of which 34 have parent entities. 14 are abstract, which I gather is also not supported. 3 of the entities are both abstract and have parent entities.)

I tried out Swift Data and thought: "Surely I'm missing something", because the only way I was able to make inheritance 'work' was by casting to the base/parent class when I wanted to save in the database, and casting to the child class when I wanted to display it, which oddly enough, somehow works, and it somehow saves fields that aren't present on the parent class, but are present on the child class. How or why is beyond me, but yea I'm hoping they add inheritance sometime soon, I'm not even sure why they would release swift data without support for inheritance.

Any progress on this issue please? I have a base class and two subclass levels like this

@Model class CreditCardAccount: LiabilityAccount { }

class LiabilityAccount: Account, LiabilityAccountProtocol {

class Account: Identifiable, AccountProtocol, Codable {

I have multiple classes similar to "CreditCardAccount": and would only instantiate the class at this level so I only need to add @Model to subclasses I want to persist. Hence "Account" and "LiabailityAccount" are not persisted.

Xcode throws up the same suggested code to a ll my subclasses which is the I should add this "@Transient private var _$backingData: any SwiftData.BackingData<CreditCardAccount> = CreditCardAccount.createBackingData()

public var persistentBackingData: any SwiftData.BackingData<CreditCardAccount> { get { _$backingData } set { _$backingData = newValue } }

static var schemaMetadata: [SwiftData.Schema.PropertyMetadata] { return [ SwiftData.Schema.PropertyMetadata(name: "creditLimit", keypath: \CreditCardAccount.creditLimit, defaultValue: nil, metadata: nil) ] }

required init(backingData: any SwiftData.BackingData<CreditCardAccount>) { _creditLimit = _SwiftDataNoType() self.persistentBackingData = backingData }

@Transient private let _$observationRegistrar = Observation.ObservationRegistrar()

struct _SwiftDataNoType { }"

Does SwiftData not allow model class inheritance?
 
 
Q