Post

Replies

Boosts

Views

Activity

Reply to Does SwiftData not allow model class inheritance?
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.
Jul ’23