It will have the simplest user interface you could imagine. I finally cracked it.
— Steve Jobs, on the future of Apple TV

We stand at the dawn of a new age of television. In September, Apple announced that the next generation of Apple TV would include tvOS, giving developers who were already writing for iOS and OSX in Objective-C and Swift a new avenue for their projects. Many of the same frameworks used in iOS will be available for tvOS which will allow existing developers to create immersive apps and games on the big screen without a steep learning curve.

To allow developers a chance to have their apps ready by the time the new Apple TV’s start shipping in late October/early November, Apple offered members of the Developer Program a chance to enter a drawing to be selected to receive an Apple TV Developer Kit for $1. That’s no typo, you read that right. One dollar. After the initial wave of Developer Kits shipped, there was such an overwhelming response to the program that they released a second, larger wave.

On October 14th, Mobile Makers Chicago office hosted a two-hour workshop for anyone interested in learning more about Apple TV, and the lucky few who received Developer Kits. We had a great turnout and a lively discussion, covering the basics of what’s possible on tvOS.

New User Interface Challenges

The new Apple TV’s are hardly a retread of last year's model. In addition to allowing third-party apps for the first time, it features a more powerful CPU, 1080p disply and a new Apple TV Remote featuring a touch surface, built-in accelerometer, and gyroscope. The possibilities of this new user experience are myriad. While a mobile app is typically an individual experience, having an app on your television can be a group experience, greatly expanding what an app experience can be. In addition to allowing for mutliple remotes to be connected, users will also have the ability to connect third-party gaming controllers. We’re just scratching the surface of what is possible with tvOS, but excitement is already at fever pitch.

Focus and Parallax Images

All of the app icons in the new Apple TV feature multilayered Parallax images. These can be created with a new tool released by Apple called the Parallax Previewer. The Parallax Previewer allows you to combine a few images into a multilayered .lcr file. The effect is that when the user brings your app into focus, by highlighting but not actually selecting the app, the icon will respond to the users touch on the new Apple TV remote. These images can also be included within the app, allowing for more unique interactions with the user. Parallax images can also be created with a plug-in for Adobe Photoshop.

Resource Limitations

One of the ways writing for tvOS differs from writing for other Apple platforms is that there’s no persistant local storage for app on Apple TV. This means that every app developed for the new Apple TV must be able to store data in iCloud and retrieve it in a way that provides a great customer experience. Along with the lack of local storage, the maximum size of an Apple TV app is limited to 200MB, which is significantly smaller than the maximum size of iOS app.

New Frameworks

Apple tvOS introduces the following new frameworks that are specific to tvOS:

  • TVMLJS. Describes the JavaScript APIs used to load the TVML pages that are used to display information in client-server apps.
  • TVMLKit. Provides a way to incorporate JavaScript and TVML elements into your app.
  • TVServices. Describes how to add a top shelf extension to your app.

In addition to those frameworks, many of the frameworks we know and love are inherited by tvOS. Here is a list of the inherited frameworks:

  • Accelerate
  • AudioToolbox
  • AudioUnit
  • AVFoundation
  • AVKit
  • CFNetwork
  • CloudKit
  • CoreBluetooth
  • CoreData
  • CoreFoundation
  • CoreGraphics
  • CoreImage
  • CoreLocation
  • CoreMedia
  • CoreSpotlight
  • CoreText
  • CoreVideo
  • Darwin
  • Foundation
  • GameController
  • GameKit
  • GameplayKit
  • GLKit
  • ImageIO
  • MachO
  • MediaAccessibility
  • MediaPlayer
  • MediaToolbox
  • Metal
  • MetalKit
  • MetalPerformanceShaders MobileCoreServices
  • ModelIO
  • OpenGLES
  • SceneKit
  • Security
  • simd
  • SpriteKit
  • StoreKit
  • Swift Standard Library
  • SystemConfiguration
  • UIKit

TVMLKit

One of the ways to write apps for tvOS is using TVMLKit which brings together elements of XML and JavaScript code to make writing client-server apps who primary purpose is to stream media very simple. Apple has provided developers with a number of different interface templates to use. For developers who are already fluent in JavaScript and XML, this is a very useful tool and removes the need to start from scratch every time they want to serve up a host of videos or other media.

Native Apps

Writing custom apps for tvOS without TVMLKit is very similar to writing any other app. In the Beta version of Xcode, the same way you can currently choose to write a Single-View Application for OS X or iOS, you can also choose one for tvOS or watchOS.

Since tvOS is already available in the Beta version of Xcode, many of our guests came armed with a working tvOS that they wanted to test out on an actual unit. The first wave of Developer Kits included a USB-C to USB-A cable to transfer apps to the Apple TV, but for some reason this hard-to-find cable was not included with the second wave. Without this cable, it’s impossible to get apps onto the Apple TV, even with Test Flight, because there is no way to get the UUID of the device without connecting it to the computer. Thankfully, one of our distinguished alumni, Mateusz Pils, was part of the first wave and allowed the participants to use his cable.

David Seitz, Jr., an alumn of the May 2015 cohort and now a developer at Vokal, was the first to present his tvOS app, which was a version of Breakout. The new Apple TV remote is very well suited to this kind of interaction, and it was great demonstration of the power of Apple TV.

Wade Sellers, an alumn of the September 2014 cohort and a developer in Denver, and one of the hosts of the event, showcased an app he made that displays movie posters that can be selected using the remote.

Ben Bueltmann, one of Mobile Makers’ instructors and an alumn of the July 2014 cohort, presented a one-player version of Pong, where the ball gets faster and faster and every time the ball hits anything, all the colors randomize. Originally written for iOS in Swift, he was able to very quickly transfer the code to tvOS, and with minimal setup in the storyboard, produce a native tvOS within an hour. The fact that his user experience mirrored David Seitz, Jr.’s Breakout app is just proof that Apple TV is perfect for this kind of interaction, and that great minds think alike.

One more thing…

The event was a huge success, bringing in alumni from many different cohorts as well as guests who had just heard about the event and wanted to learn more about tvOS. The informal discussion was bookended by workshop time to experiment with the Apple TV Developer Kit provided, and everyone got a turn to try out the new remote and see what the new Apple TV experience will be like. Filled with laughs and information, we were honored to host the event and want to send a huge thank you to all the attendees and presenters. The era of Apple TV is upon us and we couldn’t be more thrilled.