Post

Replies

Boosts

Views

Activity

Reply to ForEach Breaks Data Binding
I had the same problem: A non-updating list. The problem was: The identifiable id (representing a database ID) of each element wasn't changing, but other content of the element. So I just added a SwiftUI id to the element enclosing View, like so: ForEach(elements) {element in Button { ... actions ... } label: { MyView(content: element) .id("\(element.id)\(element.changingStuff.description)") } } That solved the problem.
Mar ’23