I'm building an app that would work better with the ability to recognize multitouch gestures (e.g. double click, triple click, and so on - ...clicks with multiple fingers). As of now, the app (or specifically a SwiftUI button) recognizes two gestures, single click and a long press. Is there an easy way to add an action to the button after a double click or a triple click on it?
Button(action: {
// action after single click
}, label: {
Text("Button")
}).simultaneousGesture(LongPressGesture(minimumDuration: 1).onEnded { _ in
isLongPressing = true
// action after long press for 1 second
})
... here's a snippet to give you an idea of how the button works in the UI. Did some research on how it could be done (this question dives into a similar if not the same topic), but couldn't seem to find a way that works for me. Thanks in advance!