@Purkylin_glow @albert.tra
Not sure if this is a good solution, but the following seems to work (it has downsides):
List {
ForEach(students.filter { $0.department?.id == department.id }) { student in
Text(student.name)
}
}
The downside is@Query would monitor changes and refresh the view even if a student is added to a totally different department.
I really wish there is a better solution ...
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: