ragnarius
ragnarius

Reputation: 5813

How to make a tvos App capture a swipe on the iPhone Remote App?

I can now (since dec 2015) use Apple's Remote App, for iOS, as a remote control for apple tv4!

I am developing a tvos App. I can swipe on the Remote App to navigate between controls on my settings screen. So far so good.

But the gesture recognisers on my game screen does not recognise the swipes on the Remote App (but they do recognise swipes on Siri Remote).

Question: What should I do to capture swipes from the iOS Remote App?

Upvotes: 1

Views: 975

Answers (1)

rickster
rickster

Reputation: 126137

You can't.

With tvOS 9.1 and v4.2.3 of the Remote app for iOS, the Control screen on the iOS app works the same as a generic remote (e.g. the Apple Remote that comes with the 3rd-generation Apple TV or a third party IR universal remote). Those remotes only support 4-way directional control, not gesture control. More generally, Remote v4.2.3 can only do with a 4th-gen Apple TV the same things it does with 3rd-gen Apple TV.

The Remote app translates the gestures you make on your iOS device into a 4-way directional command (or select/play/pause, fast-forward, or another of the few commands generic remotes support), then sends that command to the Apple TV. It doesn't pass touch inputs along to the Apple TV the way the Siri Remote does.

However, Apple has been talking to the press about possible future changes.


Directional "button" inputs, whether from an Apple Remote, third-party hardware remote, or the Remote iOS app, are UIPress events, just like the Select, Menu, and Play/Pause buttons on the Siri Remote. As such, you can handle them in pressesBegan:withEvent: or with the allowedPressTypes property of a tap gesture recognizer. You can even set up the latter in Interface Builder:

Note that swipes on the Siri remote don't count as directional button presses, so if you're doing swipe gesture recognizers and want a directional button press to do the same thing, you need to recognize both separately.

Upvotes: 3

Related Questions