Skip to content

Instantly share code, notes, and snippets.

@donnywals
Created November 9, 2015 09:21
Show Gist options
  • Save donnywals/aad691d55195e72e1fcb to your computer and use it in GitHub Desktop.
Save donnywals/aad691d55195e72e1fcb to your computer and use it in GitHub Desktop.

Axel Roest - tvOS perks and pitfalls

  • When the rumours about writing apps for Apple TV people said they were just web-apps using a silly html-like language. Then tvOS came out and we had TVML and UIKit. This made it easy for existing apps to be ported and web-developers could use TVML to make simple apps.
  • On tvOS you can use the top shelf to display some of your content.
  • The focus engine is a nice effect but it might be hard to see what’s selected. You have to wiggle your thumb and see what part moves. An example is the Air b&b app.
  • Putting content in the top shelf is done with an extra top shelf provider target.
  • There is no persistent storage next to NSUserDefaults. No data is guaranteed to be stored. The maximum cache size is 200MB. You have to use CloudKit.
  • Missing frameworks are HealthKit, CoreMotion, Contacts and Accounts. What’s weird is that HomeKit, MapKit, ReplayKit and VideoToolbox are missing. Seems like apple really wants this to be a consumer device.
  • Webkit is also missing. Axel’s guess is that, because in general people don’t browse the web on their TV, it will be a crappy experiences. If people would just port their apps it would be a bad experience.
  • Alternatives are to make your own layout engine like NetNewsWire did or to use the hacked version that’s up on github, you won’t be allowed on the App Store with that.
  • UX is very different, so you have to rethink your interactions, make sure people don’t have to type as much because text input is very annoying on the TV. The layered icons are a pretty cool addition but you have to recreate your icon to take advantage of that. You can use Apple’s preview tools to allow you designer to see what your icon will look like.
  • Funny, the compiler checks your icon images and is oddly specific about what’s wrong. For instance it can tell you which pixel has an illegal alpha value.
  • TVML apps are written with the TVJS Javascript framework. The cool thing is that you control your contents from the server. This means that you can change your app after you have shipped it. That’s very interesting because Apple won’t be able to approve your apps when you update them.
  • You can use TVML in your UIViewControllers, so you can mix and match.
  • The simulator remote works, but it doesn’t work well. Luckily you can hook up your real remote to the simulator.
  • Testing TVML is very easy but you have to reload the app from Xcode for your changes to take effect.
  • Text input is annoying, Air b&b has a nice workaround. They generate a login code that you can fill out in the web. When you do that, the Apple TV app s magically logged in.
  • Easy to go from iOS->tvOS and also to go from tvML->tvOS.
  • Question: Can you store cookies for the TVML apps ** Answer: Probably not because Cookies are not really an XML thing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment