Ricky
Ricky

Reputation: 3171

Using UITapGestureRecognizer to detect taps in tvOS

I'm trying to detect when a user taps on touch pad of the Siri Remote (not just clicks).

I've seen online that you should configure the recognizer like so.

UITapGestureRecognizer * const recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(remoteInteractionDetected:)];
recognizer.allowedTouchTypes = @[@(UITouchTypeIndirect)];
recognizer.allowedPressTypes = @[];
[self.view addGestureRecognizer:recognizer];

The selector never fires. If I remove the allowed properties, the recognizer responds to clicks only.

Is this possible?

Edit: It is not like the suggested duplicate, because I am not looking for a particular button press or swipe gesture. All I want to know is when a user touches the touch pad, not actually presses it down. Just like the new tvOS 12 Aerial screen savers show the location on this event.

Upvotes: 2

Views: 539

Answers (1)

Ricky
Ricky

Reputation: 3171

It turns out that the above code works on an actual Apple TV device, but not the tvOS Simulator in Xcode 10.0.

Upvotes: 0

Related Questions