I was using SwiftData to make a basic testing app, for the purpose of learning Swift. When I added in the @Relationship
macro, I received this error: Type 'Schema.Relationship.Option' has no member 'cascade'
. I do not understand the error 🤷🏻♂️. Can you help me out here? It would also be appreciated if you could give me a temporary fix. Thank you for your cooperation! 🤗 Here is the code:
import Foundation
import SwiftData
@Model
class TodoList {
var title: String
@Relationship(.cascade)
var items: [TodoItem]
}
@Model
class TodoItem {
let title: String
var isDone: Bool
}