What’s So Different About tvOS? An iOS Developer’s Thoughts
Apple TV was one of the biggest announcements coming out of September’s Apple event, finally bringing to reality one of the Apple’s longest-tenured rumors. With the new Apple TV, Apple is allowing us to finally create our own apps using the brand new tvOS platform, opening up the Apple TV to developer apps in the same way that iOS and OSX have done. This provides an exciting new platform for both developers and consumers to reach their audience and provide new experiences for users.
During this blog post I’ll review quickly what Apple announced for tvOS and share my first impressions about the new Apple TV after having spent some time playing around with the SDK.
For the most part, tvOS is inheriting a lot of frameworks from iOS; you can find the complete list here. For iOS developers, tvOS should feel very familiar, so let’s take a look at some of the new frameworks available for Apple TV that will not be as familiar.
With tvOS, developers and designers are facing a new challenge: navigating an app without touch input. We are accustomed to developing apps with open-ended interfaces, allowing the user to navigate as they please; with tvOS, however, we now have to change our thought-process to a more linear navigation, one where users can only move from element to element in a strict fashion. To resolve this major issue and provide a good user experience, Apple worked on a focus engine that will help users seamlessly navigate the different elements of your app.
The focus engine provides context for the user’s interaction by giving emphasis to elements that are currently in focus. It does this by zooming in and giving it feedback. Moving your finger on the remote touch pad will switch between focusable elements and tapping on the remote will perform an action, just like clicking a mouse or tapping a touchscreen.
Only specific elements are focusable where it makes sense to have an action when tapping:
For collection views and table views, you need to implement delegate methods to let the system know which cell is focusable using
tvOS provides some APIs to know what element is currently focused and how to respond to focus updates. You can also tell the system which element should be focused first when pushing to the view so the user doesn’t have to scroll manually. For example, if you have a page containing a video with a play button, you probably will want to immediately focus on the play button when the page opens to let users start the video right away.
The focus engine doesn’t provide a default appearance for UICollectionView cells, so if your cell contains a UIImageView, you need to enable its default focus appearance:
imageView.adjustsImageWhenAncestorFocused = true
You can also tell the system which element should be focused first by requesting an update of the focus engine during the next update cycle:
For more details about the tvOS focus engine I recommend reading this blog post explaining how to play around with it.
App Icon Parallax Effect
tvOS introduces a built-in parallax effect for developers. The app icon can be created using different image layers, and the system will automatically create the parallax effect for you, no extra work needed. To create your icon, you can either use the Xcode xcassets folder or use Apple’s Parallax Previewer software available on Apple’s developer portal. Both will ask you to provide one or multiple images and and then will generate a file for you that tvOS can consume to create the effect. For the most part, this effect is made up of three images: background, middle and foreground images, which combine to generate amazing parallax effects very easily.
- TVML: Television Markup Language, used to create an individual page using XML format.
Building apps for Apple TV comes with some limitations. If you are a video game developer, you should of course consider the hardware specs for graphics (as always), but for most apps the new A8 CPU should be more than enough to handle your content. Outside of hardware concerns, here are some limitations for developers to consider when working on your app:
App size limit
An Apple TV app cannot be more than 200MB when downloaded from the App Store. If your data exceeds that limit, you will have to use the iOS 9 On-Demand APIs to asynchronously download and install specific parts of your app.
No persistent storage
There is no persistent storage for Apple TV apps; anything that is stored locally can be deleted at anytime by the system without warning you before. If your app needs to store data, you have to use iCloud Kit or your own personal database system.
No web views
“Minority Report” is not real yet, so the only way to interact with apps is the Apple TV remote, and this will impact the way you design and program your app. Think about the user experience a lot before digging into the code and trying it on the simulator. You will be surprised to see how hard it is to use the simulated remote to navigate your app. These are the obstacles that will need to be overcome when you begin build an app for tvOS.
After working a little bit with the beta SDK, I am really happy to see that tvOS is pretty stable. I did not experience any crashes or major issues; however, my prototype app was also pretty basic so I may not have encountered them.
For a brand new product, the documentation is already very detailed and helpful, for both UX and development. This makes it easy to jump in and make a solid, production-level tvOS app without much trouble since everything that you need to do is outlined very clearly. Be sure to comb through Apple’s developer portal resources for tvOS before starting on your app.
Finally, I’d like to share the prototype I worked on for this post to test the tvOS SDK and get a feel for how it works. The app is pretty simple, pulling in videos from one of my favorite (French) YouTube channels, displaying them in a grid, and pushing a detail page with a play button to start streaming the video directly through your Apple TV. While the project is definitely rough around the edges, I feel that it highlights many of the elements that I discussed in this post, and it should act as a decent example for anyone jumping into tvOS development without any reference. Be sure to check it out on GitHub.