Hello together, I hope someone can answer and can give me maybe a little guidance. Is it possible to access and change a child value from a child class in SwiftData? I tried now different ways but couldn't get it to work although I don't get any errors but I am not able to change or set any values.
So the code example below is only a simplified example and I know some minor errors but it is about the principle. Can the Father class access somehow the Children class and for example read the childrenName?
@Model class Father {
var father: String
var child: Child?
}
@Model class Child {
var childName: String
var child: Children?
var father: Father
}
@Model class Children {
var childrenName: String
var parent: Child
}
I don't need direct access from the Father to the Children class - it has to go via the child class.
Thanks for any direction or feedback in advance.