I'd like to notice when a user clicks their Siri remote with two fingers on the trackpad instead of one. (A one-finger click increments; I'd like a two-finger click to decrement.) Is there a way to do this? A UITapGestureRecognizer with numberOfTouchesRequired set to 2 seems like the obvious solution, but it doesn't seem to be getting me anywhere.
Can you detect a two-finger click?
tvOS supports two gestures, but not sure about twin simultaneous discrete clicks... I think a click is a click.
If UITapGestureRecognizer isn't working for you try implementing touchesEnded. Haven't tested this, but think this should point you in the right direction
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
switch([touches count]) {
case 1: {
[self doSingleTouchThing];
break;
}
case 2: {
[self doDoubleTouchThing];
break;
}
}
}
UIKit won't recognize more than a single touch on the Siri Remote trackpad, so numberOfTouchesRequired is ignored: there can only ever be one touch at a time. That property is marked as prohibited on tvOS, so I'm not sure how you're even able to set that property: it should be a compiler error to try to use it.