What's similar to iOS?
→ everything
→ Xcode, Interface Builder, Objective-C, Swift
→ frameworks (UIKit, Metal, CloudKit, Game Center,
and more)
Slide 3
Slide 3 text
What's different from iOS?
→ user interaction (Siri remote)
→ focus engine
→ a few missing parts
→ the App Store and assets
→ (new) TVML, JavaScript, TVMLKit
→ views & view controller appearance
Slide 4
Slide 4 text
User
interaction
Slide 5
Slide 5 text
No content
Slide 6
Slide 6 text
No content
Slide 7
Slide 7 text
Remote
Slide 8
Slide 8 text
No content
Slide 9
Slide 9 text
Focus
Slide 10
Slide 10 text
"A UI element is in focus
when the user highlights
an item, but has not
selected an item."
Slide 11
Slide 11 text
Focus
→ UIFocusGuide
→ Adam made some awesome slides
Slide 12
Slide 12 text
No content
Slide 13
Slide 13 text
What do these have in common?
→ Photos framework
→ Multipeer Connectivity
→ EventKit
→ local storage
→ web views
Slide 14
Slide 14 text
Storage
→ no persistent local storage
→ NSUserDefaults: 500K
→ CloudKit
Layered icon
Two sizes
→ Large: 1280 x 768
→ Small: 400 x 240
Slide 20
Slide 20 text
Top Shelf
image
Slide 21
Slide 21 text
No content
Slide 22
Slide 22 text
Capture
(just like iOS)
→ Screen shots: Xcode
→ Video: QuickTime Player
Slide 23
Slide 23 text
No content
Slide 24
Slide 24 text
Views & View Controllers
UIKitCatalog
Slide 25
Slide 25 text
No content
Slide 26
Slide 26 text
TVML
Slide 27
Slide 27 text
TVML and JavaScript
"client-server apps whose primary purpose is to
stream media"
Slide 28
Slide 28 text
Why TVML?
you can change stuff after it's deployed
Slide 29
Slide 29 text
TVML Architecture
Slide 30
Slide 30 text
No content
Slide 31
Slide 31 text
TVML and JavaScript
1. write some TVML (XML) & JavaScript
2. put it on your server
3. write a TVMLKit app that points to your server
4. submit your TVMLKit app to Apple
Slide 32
Slide 32 text
No content
Slide 33
Slide 33 text
PLAY
SCENES
EXTRAS
Slide 34
Slide 34 text
// application.js
doc.addEventListener("play", startPlayback);
// ...
function startPlayback(event) {
var player = new Player();
// ...
player.playlist.push(video);
// ...
player.play();
}
Slide 35
Slide 35 text
class AppDelegate: UIResponder, UIApplicationDelegate,
TVApplicationControllerDelegate {
var appController: TVApplicationController?
static let TVBaseURL = "http://localhost:9001/"
static let TVBootURL = "\(AppDelegate.TVBaseURL)js/application.js"
func application(application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// ...
let appControllerContext = TVApplicationControllerContext()
if let javaScriptURL = NSURL(string: AppDelegate.TVBootURL) {
appControllerContext.javaScriptApplicationURL = javaScriptURL
}
appControllerContext.launchOptions["BASEURL"] = AppDelegate.TVBaseURL
appController = TVApplicationController(context: appControllerContext,
window: window, delegate: self)
// ...
}
Slide 36
Slide 36 text
thanks
Slide 37
Slide 37 text
Questions?
@jtbrown
Slide 38
Slide 38 text
Further Reading
tv Human Interface Guidelines
200MB Max, No Storage, No Web Views: Is tvOS the
Future of Apps?
Beginning tvOS Development with TVML Tutorial