I have a list to which I need to attach a swipe action:
struct TestListView: View {
var items = ["A", "B", "C"]
var body: some View {
List() {
ForEach(0 ..< items.count, id: \.self) { idx in
let item = items[idx]
Text("\(item)")
}
.swipeActions {
Button("Person") {
// Do Something
}
.tint(.red)
}
}
}
}
Unfortunately, the text doesn't appear on watchOS:
Exactly the same code works on iOS:
What am I doing wrong?