AFAIK Create a view history table and apply cascade rule
Post
Replies
Boosts
Views
Activity
It seems no method to get the mainContext injected in environment directly, and the context is not sendable, you can not use it on other actor/thread. But you can get the context from your model like model.context.
actor BackgroundActor: ModelActor {
nonisolated public let executor: any ModelExecutor
init(container: ModelContainer) {
let context = ModelContext(container)
executor = DefaultModelExecutor(context: context)
}
func run(task: (ModelContext) -> Void) {
task(context)
}
}
You can use this wrapper like this:
databaseActor.run { context in
// ....
}
Deleted
@Relationship(.nullify, inverse: \Group.members) var group: Group
group must be optional
You should extract a variable for the name.
let tmp = other.name
#Predicate<OnlyName> { $0.name == tmp }
How about:
ForEach(department.students) { student in
Text(student.name)
}
Same problem if I append a value to path (NavigationPath).
Tested in Xcode 14 beta 5
I have a similar problem. There is a not elegant solution: force cast.
switch item:
case is Item1
let binding = Binding(...)
RowView(item: binding)
default:
fatelError("Unknown Item")
}