One thing I noticed here is that this seems wrong:
ForEach(self.checks.indices, id: \.self) { i in
CheckView(check: self.$checks[i])
}
You already have the individual check captured in the i parameter when you do { i in }.
So you don't need to do $checks[i]
You cans simply do:
ForEach(checks, id: \.self) { check in
CheckView(check: check)
}
You also don't need the indices, you have access to the complete object inside your array within the closure.
Furthermore, if you make your check model conform to Identifiable and Hashable (easily done with let id = UUID()) then you don't need the , id: \.self bit either.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: