4

How can I detect a "click press", not just a tap, on the touchpad on siri remote?

EDIT: My main problem was that my view had an UIButton that received the event.

ragnarius
  • 5,642
  • 10
  • 47
  • 68
  • 1
    Possible duplicate of [Forced Touch with tvOS](http://stackoverflow.com/questions/32812468/forced-touch-with-tvos) – Daniel Storm Nov 10 '15 at 12:53

2 Answers2

6

By reading the UIPressesEvent's. Detecting Gestures and Button Presses

override func pressesEnded(presses: Set<UIPress>, withEvent event: UIPressesEvent?) {
    for press in presses {
        if (press.type == .Select) {
           // Select is pressed
        }  else {
            super.pressesEnded(presses, withEvent: event)
        }
    }
}
Jeroen Bakker
  • 2,142
  • 19
  • 22
2

My main problem was that my view had an UIButton that received the event. After disabling that button in the storyboard, the pressesBegan / pressesEnded are invoked.

ragnarius
  • 5,642
  • 10
  • 47
  • 68