This document provides an overview of developing apps for tvOS, Apple's operating system for the Apple TV. It covers the Apple TV hardware, the Siri remote controller, types of tvOS apps like games and TVML-based apps, the focus engine for navigation, limitations of tvOS apps, and resources for developers. The focus engine allows apps to specify focusable views but not directly control focus, and debugging tools are provided. TV services extensions and parallax images are also discussed.
8. PARALLAX IMAGES
• Made up of layered
images
• Can produce them with:
• Xcode
• Parallax Previewer
App
• Photoshop plugin
9. LIMITATIONS
• Max size of app bundle is 200MB. If greater, must use On-Demand Resources
• Limited persistent storage
• 500KB
• Accessed through NSUserDefaults
• Persistent storage > 500KB
• For < 1MB, use iCloud Key-Value Storage
• For > 1MB, use CloudKit
• Must implement your own user accounts, since device has only one iCloud account
• No UIWebView
10. LIMITATIONS
• Apps have to be submitted as BitCode
binaries
• This includes embedded frameworks
• Most closed-source 3rd party frameworks
won’t be usable on tvOS
11. THE GOOD NEWS
• Can usually assume high-bandwidth, low-
latency networks
• Screen size always the same (1080p)
• Don’t have to worry about rotation, size class
changes
13. TVML-BASED APPS
• TVApplicationController
is created in App
Delegate
• Attached to key
UIWindow and
UIApplicationDelegate
• Everything else handled
by accessing Javascript
and TVML
14. UIKIT-BASED APPS
• Most of tvOS is a subset of iOS
• Most ideas from UIKit translate directly
• Check the iOS/tvOS API diffs in Release
Notes
• https://developer.apple.com/library/tvos/rel
easenotes/General/tvOS90APIDiffs/index.h
tml
15. INDIRECT VS DIRECT
• Direct Interaction (iPhone, iPad, etc)
• Swipe left, content moves left
• Indirect Interaction (tvOS)
• Focus-based
• Swipe left:
• FOCUS moves left
• CONTENT moves right
16. FOCUS ENGINE
• Your app CAN:
• Specify what views can become focused
• Can request a focus update
• Provide a visual indication of focus
• Can coordinate any focus-related animation
• Your app CANNOT directly control focus
17. FOCUS-ABLE CLASSES
• UIButton
• UIControl
• UISegmentedControl
• UITabBar
• UITextField
• UISearchBar
• Cells
• UICollectionViewCell
• UITableViewCell
• Can be disabled via
delegate
18. UIView Focus Details
• Custom UIView subclasses can override
canBecomeFocused()
• Can check focused state with .focused
property
• Sample code to demonstrate this:
• https://github.com/ehyche/TVOSFocusExa
mple
21. DEBUGGING FOCUS
ISSUES
• Undocumented UIView method:
• _whyIsThisViewNotFocusable
• Gives you the reason the focus engine did
not focus on a particular view
• Quick Look on UIFocusUpdateContext
22. TV SERVICES EXTENSION
• Can provide static Top-Shelf Image
• If you want dynamic top-shelf data, then you
need a TV Services extension
• Sample TV Services Extension code:
• https://github.com/ehyche/FlickrTV
24. APPLE DOCS
• Human Interface Guidelines
(https://developer.apple.com/tvos/human-interface-guidelines/)
• App Programming Guide for tvOS
(https://developer.apple.com/library/prerelease/tvos/documentati
on/General/Conceptual/AppleTV_PG/)
• tvOS Developer Library
(https://developer.apple.com/library/tvos/navigation/)
• Framework References
• API Diffs
25. APPLE RESOURCES
• Sample Code
(https://developer.apple.com/library/tvos/navigation/#secti
on=Resource%20Types&topic=Sample%20Code)
• Downloads (https://developer.apple.com/tvos/download/)
• Parallax Previewer Mac OSX app
• Parallax Exporter Photoshop Plugin
• Photoshop Icon and Image Templates
26. USEFUL BLOGS
• AppleTV Weekly (appletvweekly.com)
• Erica Sadun’s Blog (ericasadun.com)
• Daniel Pasco’s Black Pixel Blog
(https://blackpixel.com/writing/)
27. OTHER RESOURCES
• Slack Group for Apple TV
(appletv.slack.com)
• Keynote template for prototyping apps
(https://medium.com/@itsleesimpson/appletv
-app-design-template-for-keynote-
90cac633cd92#.p7zvheak8)
• Tutorials (tutsplus.com, raywenderlich.com)