Emre Çimen
Emre Çimen

Reputation: 45

How do we use Watchkit Touch Events?

I wanna use touch events in my app. I know gesture recognisers can not be used in watchKit. Is it possible to use functions like touchesBegan, touchesMove etc ?

Upvotes: 2

Views: 3840

Answers (3)

brindy
brindy

Reputation: 4695

A little late to the party, but it's possible to use SceneKit with WatchKit and SceneKit allows you to add gesture handlers. Please see the Apple example project here:

https://developer.apple.com/library/content/samplecode/WatchPuzzle/Introduction/Intro.html#//apple_ref/doc/uid/TP40017284-Intro-DontLinkElementID_2

Edit: Looks like Tap, Swipe, Long Press and Pan gesture handles can be added to any view added to the InterfaceController.

Upvotes: 2

Jacky Li
Jacky Li

Reputation: 51

There is no such an api like "touchesBegan" or "touchesMove".

The only thing you can do to respond to a button event is to use IBAction.

Upvotes: 5

GoodSp33d
GoodSp33d

Reputation: 6282

Apple Watch app uses WatchKit framework. UIKit events are not applicable here.

Alternate is to use forced touch event which triggers Context Menu (if available)

Instead of just tapping items on the screen, pressing the screen with a small amount of force activates the context menu (if any) associated with the current interface controller.

Upvotes: 6

Related Questions