SwiftUI hide list item from list item view
问题 So, let's say I have a SwiftUI List and Toggle (heavily simplified): List { Toggle(isOn: $isOn) { Text("Toggle") } ForEach(arr) { item in if isOn || !item.isComplete { Row(item: item) } } } Then my Row: HStack { Button(action: { self.item.isComplete.toggle() // isComplete is a Boolean value }) { Text("Button") } Text(item.isComplete ? "Complete" : "Not complete") } The toggle should change the list, swapping between all items, and only non-completed items. This works perfectly. However, I