1

我正在寻找 iPhone 与 Apple TV 交互的开发人员指南。我不是在谈论为 Apple TV 开发应用程序。我说的是通过 iPhone 应用程序与 Apple TV 进行交互。谁能指出我正确的方向?

4

1 回答 1

3

I've asked this question before, and written an iOS app that fully supports an external screen and I've found there's very little you can actually do besides put stuff in a separate UIWindow.

An Apple TV presents itself to your iOS device as an AirPlay device and you can use it as an external screen and also send and receive remote control events if it's playing media from your device with some of the built in movie controllers.

If you connect to an AppleTV your app will receive a UIScreenDidConnectNotification and you can then choose to place a UIWindow in the second UIScreen instance made available to you.

Two places to look are:

Edit (changed the order)

  1. Apple's View Programming Guide probably has the most useful information on external screens and windows. I've linked to the section on windows that mentions external screens explicitly.

  2. UIScreen documentation

  3. Event Handling Documentation is less useful, as it only really applies if you're playing media from the Music App etc.

Hope that helps!

于 2012-08-20T11:36:04.517 回答