Recognizing touches on the Apple Watch

I just started trying to make a game for the Apple Watch using XCode 11.3, Swift 5.0, WatchKit and SpriteKit. I managed it to get the SKScene working, but now I am stuck. I don't know how to recognize if the user has touched a Sprite or generally if and where the user has touched the screen.

I already searched for a solution on the internet, but I didn't find any. I hope you can help me! 😄

Replies

Add a WKInterfaceButton to any group WKInterfaceGroup.

Thank you for your answer, but as I said, I want to know if the user has tapped a (SK-) Sprite or if and where the user has touched the screen. So a WKInterfaceButton wouldn't help, would it?

You can fill the entire screen with a button and then add things inside that button.


" and where the user has touched the screen"

You can add multiple buttons to the screen.

"You can fill the entire screen with a button and then add things inside that button.":

This would not help. I would neither know if a particular Sprite was touched, or where the user has touched the screen (Or is there a way to get the exact location where the user has touched the button?).

And since I am using SpriteKit, I can't "add things inside the button" because these things would have to be SKSprites (or the whole SKScene).

"You can add multiple buttons to the screen.":

But in order to check if a Sprite was touched, I'd have to know the exact position of the touch.

(Like touchesBegan and then getting the location of the touch as it works for IOS Apps. But sadly there is no touchesBegan for watchOS-Apps) 🤔

=> I need to know either if the user has touched a SKSprite or exactly where the user has touched the screen!