We have a Swiftdata model such as:
@Model
class MyThing {
var name:String
var myObject: MyCustomObject
//...
}
In order for "myObject" (which is also an @Model) to automatically get deleted when an instance of MyThing is deleted, we need to add the attribute(?), Relationship(.cascade) to myObject.
This is shown in this tutorial:
... and this Apple video:
But when I try to do it, this happens (there seems to be no option to do it)... and if I manually type it out it says it's not found:



Those resources you found are out of date. There should be an argument label
deleteRule:.See also the signature of the macro in the documentation.
Without an argument label, the compiler thought
.cascadewas passed to theoptionsparameter.