I hope this is relevant to this forum,
I'm trying to build a simple List in SwiftUI, each row will perform an action on tap, here's a sample code:
struct ContentView: View {
var body: some View {
List {
ForEach(1..<10) { i in
Text("Hello, world!")
.onTapGesture {
print("Tapped: ", i)
}
}
}
}
}
This works, however, if user multi-taps on two rows, the console is going to print twice. Not great if I'm pushing a secondary view controller. Is there a way to have some sort of exclusiveTouch
property to each List item?