Building Apps for Apple TV
by David Olesch
DavidOlesch.com 1
Should you make an app for
Apple TV?
DavidOlesch.com 2
In 2014, watching TV
accounted for more than
half of leisure time.
1
U.S. Bureau of Labor Statistics
DavidOlesch.com 3
Building Apps for Apple TV
1. tvOS frameworks
2. Using open source libraries
3. Managing data on tvOS
4. Limitations of tvOS
5. tvOS design
DavidOlesch.com 4
Two options for writing
code
DavidOlesch.com 5
tvOS inherits many
frameworks from iOS
DavidOlesch.com 6
DavidOlesch.com 7
Does Cocoapods support
the tvOS platform?
DavidOlesch.com 8
Not all Cocoapods libraries
support the tvOS platform
DavidOlesch.com 9
If a library doesn't yet support tvOS
(Step 1.)
# LibraryName.podspec
s.tvos.deployment_target = '9.0'
DavidOlesch.com 10
If a library doesn't yet support tvOS
(Step 2.)
DavidOlesch.com 11
If a library doesn't yet support tvOS
(Step 3.)
// SomeClass.m
#if TARGET_OS_IOS
- (void)updateMotionEffectForOrientation:(UIInterfaceOrientation)orientation;
#elif TARGET_OS_TV
- (void)updateMotionEffect;
#endif
DavidOlesch.com 12
Many open source libraries
have been updated to work
with tvOS.
DavidOlesch.com 13
Local storage can be deleted
at any time !
DavidOlesch.com 14
iCloud Key-Value Store
limited to 1MB
// Writing to iCloud.
NSUbiquitousKeyValueStore *store = [NSUbiquitousKeyValueStore defaultStore];
if (store != nil) {
[store setObject:object forKey:key];
[store synchronize];
}
DavidOlesch.com 15
iCloud Key-Value Store
limited to 1MB
// Reading from iCloud.
NSUbiquitousKeyValueStore *store = [NSUbiquitousKeyValueStore defaultStore];
id object = [store objectForKey:key];
DavidOlesch.com 16
Apple TV is controlled by
the new Siri Remote
DavidOlesch.com 17
Building Apps for Apple TV
1. tvOS frameworks
2. Using open source libraries
3. Managing data on tvOS
4. Limitations of tvOS
5. tvOS design
DavidOlesch.com 18
LimitationsNo push notifications
No app badges
No web views
DavidOlesch.com 19
Apple TV Design
should be primarily grid based
DavidOlesch.com 20
Take advantage of the Top Shelf
DavidOlesch.com 21
Take advantage of the Top Shelf
DavidOlesch.com 22
Take advantage of the Top Shelf
#pragma mark - TVTopShelfProvider protocol
- (TVTopShelfContentStyle)topShelfStyle {
return TVTopShelfContentStyleSectioned;
//return TVTopShelfContentStyleInset;
}
- (NSArray *)topShelfItems {
return @[[[TVContentItem alloc] init]];
}
DavidOlesch.com 23
Questions?
DavidOlesch.com 24
Join me at the Apple TV
Hackathon
Capital Factory 5th Floor
November 22nd 8:30 am - 7:30 pm
DavidOlesch.com 25

Building Apps for Apple TV

  • 1.
    Building Apps forApple TV by David Olesch DavidOlesch.com 1
  • 2.
    Should you makean app for Apple TV? DavidOlesch.com 2
  • 3.
    In 2014, watchingTV accounted for more than half of leisure time. 1 U.S. Bureau of Labor Statistics DavidOlesch.com 3
  • 4.
    Building Apps forApple TV 1. tvOS frameworks 2. Using open source libraries 3. Managing data on tvOS 4. Limitations of tvOS 5. tvOS design DavidOlesch.com 4
  • 5.
    Two options forwriting code DavidOlesch.com 5
  • 6.
    tvOS inherits many frameworksfrom iOS DavidOlesch.com 6
  • 7.
  • 8.
    Does Cocoapods support thetvOS platform? DavidOlesch.com 8
  • 9.
    Not all Cocoapodslibraries support the tvOS platform DavidOlesch.com 9
  • 10.
    If a librarydoesn't yet support tvOS (Step 1.) # LibraryName.podspec s.tvos.deployment_target = '9.0' DavidOlesch.com 10
  • 11.
    If a librarydoesn't yet support tvOS (Step 2.) DavidOlesch.com 11
  • 12.
    If a librarydoesn't yet support tvOS (Step 3.) // SomeClass.m #if TARGET_OS_IOS - (void)updateMotionEffectForOrientation:(UIInterfaceOrientation)orientation; #elif TARGET_OS_TV - (void)updateMotionEffect; #endif DavidOlesch.com 12
  • 13.
    Many open sourcelibraries have been updated to work with tvOS. DavidOlesch.com 13
  • 14.
    Local storage canbe deleted at any time ! DavidOlesch.com 14
  • 15.
    iCloud Key-Value Store limitedto 1MB // Writing to iCloud. NSUbiquitousKeyValueStore *store = [NSUbiquitousKeyValueStore defaultStore]; if (store != nil) { [store setObject:object forKey:key]; [store synchronize]; } DavidOlesch.com 15
  • 16.
    iCloud Key-Value Store limitedto 1MB // Reading from iCloud. NSUbiquitousKeyValueStore *store = [NSUbiquitousKeyValueStore defaultStore]; id object = [store objectForKey:key]; DavidOlesch.com 16
  • 17.
    Apple TV iscontrolled by the new Siri Remote DavidOlesch.com 17
  • 18.
    Building Apps forApple TV 1. tvOS frameworks 2. Using open source libraries 3. Managing data on tvOS 4. Limitations of tvOS 5. tvOS design DavidOlesch.com 18
  • 19.
    LimitationsNo push notifications Noapp badges No web views DavidOlesch.com 19
  • 20.
    Apple TV Design shouldbe primarily grid based DavidOlesch.com 20
  • 21.
    Take advantage ofthe Top Shelf DavidOlesch.com 21
  • 22.
    Take advantage ofthe Top Shelf DavidOlesch.com 22
  • 23.
    Take advantage ofthe Top Shelf #pragma mark - TVTopShelfProvider protocol - (TVTopShelfContentStyle)topShelfStyle { return TVTopShelfContentStyleSectioned; //return TVTopShelfContentStyleInset; } - (NSArray *)topShelfItems { return @[[[TVContentItem alloc] init]]; } DavidOlesch.com 23
  • 24.
  • 25.
    Join me atthe Apple TV Hackathon Capital Factory 5th Floor November 22nd 8:30 am - 7:30 pm DavidOlesch.com 25