It is my understanding that you need both a List and a ForEach, thus:
List {
ForEach(numbers, id: \.self) { name in
Button(action: {}) {
Text(name)
}
.onDelete(perform: removeRows)
}
This works fine, except that, unfortunately, on WatchOS 8.1, it will blow up if you reduce the number of items to zero.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: