ragnarius ragnarius - 1 year ago 91
Swift Question

How to detect click-press on the touchpad on Apple TV's remote?

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

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

Answer Source

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)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download