Ghostboard pixel

tvOS Development

tvOS Development

Just a week ago Apple introduced tvOS, which is a completely new platform in the Apple universe. And as an iOS developer, you will love tvOS development.

Client-Server Apps

It was a little bit irritating at first to hear about the so-called client-server apps based on JavaScript. However, it is a good possibility to build apps with a simply user interface. The idea is, that the app is just a container that accesses JavaScript resources on a server. The whole definition of the user interface is defined in so-called TVML files, that contain some form of XML. The logic can be programmed with a set of JavaScript APIs (TVJS).

Custom Apps

Custom Apps are those kind of apps most iOS developers will like the most. tvOS gives you the possibility to use many of the known iOS frameworks. Though, they are a little bit modified to adopt to the different user interface demands.

You can build your user interface in as storyboard as usual. There are all the UIKit classes you are familiar with: UILabel, UIButton, UIViewController, UITableView and so on. For example, you can place a button on a view controller and create a segue to another view controller. It is all very familiar. As in iOS development, it is up to you if you want to use Swift or Objective-C.

However, one very big difference of tvOS is, that it lacks a webview. So there is no possibility at all to render HTML. Since a lot of native apps have webviews to display at least things like an imprint, there will be some work to port those apps to tvOS.

Focus Engine

Although everything feels very familiar, there is one important new concept: The focus engine. On tvOS, there is always on element that is in focus. This can be for example a button or a table view cell. Using the touch area of your Apple TV remote, you can switch the focus to another element. If you are already using an Apple TV, this concept might be very familiar for you.

The great news is, that you as a developer don’t have to do a lot for it. The OS recognises on its own which element to focus if you are swiping on your remote. Though you have the possibility to customise this behaviour.

Storage

On the Apple TV app you can’t use local storage because it is not guaranteed that the data will be permanentely available. Instead, you have to use the iCloud Key-Value-Storage (at most 1MB) and CloudKit. But this is not a problem at all, because contrary to iOS devices, the Apple TV will almost always have an internet connection.

The size of an Apple TV app is restricted to 200MB. In order to build larger apps, you have to use On-Demand Resources introduced at WWDC 2015.

Games

For games you can use Sprite Kit, Scene Kit and even Metal. Although Apple only showed casual games at the tvOS presentation, it is very likely that there will be console-class games in the future as well.

[thrive_text_block color=”blue” headline=”Conclusion”]The best part of tvOS is, that every iOS developer can build very quickly apps for it. All the technologies introduced over the last years like CloudKit, On-Demand Resources, AutoLayout and Metal make it very straight forward to develop for tvOS. These are ideal conditions for the Apple TV to become a huge success.[/thrive_text_block]

References:

Image: @ aon168 / shutterstock.com
App Programming Guide For tvOS