WKInterfaceButton onTouchDown

Hey everyone,

I need to be able to determine how long the user holds down a button on the watch. My initial idea was to listen to the on touch event, store the date, then compare it to when they let up. However, only touch up events are possible as far as I can tell.

This is essential to improving my Morse Code app, any ideas on how I can make it happen?


I'll update this post if I find a solution.


Related question:

https://forums.developer.apple.com/message/18158#18158


Thanks!

Replies

Update:

I found WKGestureRecognizer. I added two long press gesture recognizers to my WKInterfaceButton, one for short taps and one for long presses.

Specs:

Long press representing a tap:

Min duration: 0 seconds

Must fail first: other long press

Long Press representing a long press:

Min duration: 0.1 seconds


I was unable to get the tap gesture recognizer to work, that's why I used to long press gestures. I imagine the button's own tap recognizer was conflicting.


I will likely have to continue experimenting with these values. Hopefully this will help someone else stumped by WKInterfaceButton's lack of touch down events.