Recognizing double tap gesture (fingers!) in Storyboard app

I have an app that uses Storyboard (not SwiftUI). Is there a way to define that a particular WKInterfaceButton should receive the "sent action" (as if the user tapped the button on screen) when the user uses the double-tap gesture with their fingers?

Answered by Frameworks Engineer in 812260022

If I’m understanding correctly, you want to use the Double Tap gesture that’s available on Apple Watch Series 9 and later and Apple Watch Ultra 2. It is not possible to use the Double Tap gesture with storyboards, which were deprecated as of watchOS 7. The .handGestureShortcut modifier is SwiftUI API only.

https://developer.apple.com/documentation/watchos-apps/enabling-double-tap/

Navigating in the storyboard for Watch is always tricky.

But, YES, you can.

Open the library to find gestures

You drag a tapGesture on the object you want to double tap. It will appear in the hierarchy.

You set its attributes with Attribute Inspector

You connect the gesture to an IBAction in its controller to connect to the destination :

   @IBAction func tapOnImage(_ sender: Any) {
        
        presentController(withName: "Detail", context: self)
        
    }

Hope that helps. If so, don't forget to close the thread by marking the answer as correct.

Accepted Answer

If I’m understanding correctly, you want to use the Double Tap gesture that’s available on Apple Watch Series 9 and later and Apple Watch Ultra 2. It is not possible to use the Double Tap gesture with storyboards, which were deprecated as of watchOS 7. The .handGestureShortcut modifier is SwiftUI API only.

https://developer.apple.com/documentation/watchos-apps/enabling-double-tap/

Recognizing double tap gesture (fingers!) in Storyboard app
 
 
Q