I have implemented 2 different methods and neither can give me a result when the main select button is pressed on siri remote. I am pressing a button and want to detect when 'button down' and 'button up'.
I can detect when both play/pause & menu buttons are pressed but no result for select button. Has me stumped 😕
UITapGestureRecognizer *selectButtonGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
selectButtonGesture.allowedPressTypes = @[[NSNumber numberWithInteger:UIPressTypeSelect], [NSNumber numberWithInteger:UIPressTypePlayPause]];
[self.view addGestureRecognizer:selectButtonGesture];
-(void)handleTap:(UITapGestureRecognizer *)sender {
if (sender.state == UIGestureRecognizerStateBegan) {
NSLog(@"button pressed");
} else if (sender.state == UIGestureRecognizerStateEnded) {
NSLog(@"button released");
}
}
- (void)pressesBegan:(NSSet<UIPress *> *)presses withEvent:(UIEvent *)event {
for (UIPress *item in presses)
{
NSLog(@"item = %@", item);
}
}