Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
tvOS App Development
Search
toshi0383
April 16, 2016
Programming
530
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
tvOS App Development
toshi0383
April 16, 2016
More Decks by toshi0383
See All by toshi0383
CoreDataはじめました
toshi0383
0
190
Swiftコードバトル必勝法
toshi0383
1
370
Sheets API使ってみた
toshi0383
2
430
visionOSについてGlobeeが取り組んでいること
toshi0383
0
620
agile20150512-150512055145-lva1-app6892.pdf
toshi0383
0
270
たのしいAirPlay
toshi0383
1
810
Profiling using Signpost
toshi0383
2
1.1k
AVPlayer周りの設計tips
toshi0383
6
940
cmdshelf::from("Swift")
toshi0383
3
950
Other Decks in Programming
See All in Programming
Family mrubyの進捗
kishima
1
130
Security issues being discussed on Web Platforms
petamoriken
0
1.2k
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
650
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
120
Workers Cache を知る
syumai
0
210
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
3
370
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
300
wkhtmltopdfの次どうするか問題2026
willnet
2
1.6k
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
160
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
3.1k
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
910
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
510
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Odyssey Design
rkendrick25
PRO
2
810
The Limits of Empathy - UXLibs8
cassininazir
1
690
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
2k
HDC tutorial
michielstock
2
890
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
510
A Tale of Four Properties
chriscoyier
163
24k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
500
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
410
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Transcript
TVOS APP DEVELOPMENT APRIL 16, 2016 SAT. 1 — ©
Toshihiro Suzuki 2016
TOSHIHIRO SUZUKI > ླ ढ़༟ > @toshi0383 > iOS/Mac/tvOS develper
> currently at NEXTSCAPE 2 — © Toshihiro Suzuki 2016
TOSHIHIRO SUZUKI > Develops Apps and contribute to OSS >
Drives go-kart > Drummer > Snowboarder > try! Swift attendee 3 — © Toshihiro Suzuki 2016
TVOS IS A NEW PLATFORM WE CAN USE THE NEWEST
APIS 4 — © Toshihiro Suzuki 2016
TO TRY OUT NEW THINGS 5 — © Toshihiro Suzuki
2016
IS FUN. 6 — © Toshihiro Suzuki 2016
APPLETV 7 — © Toshihiro Suzuki 2016
HAS VERY UNIQUE USER INTERFACE. IT'S OUR NEW TOY !
8 — © Toshihiro Suzuki 2016
ALSO THERE IS 9 — © Toshihiro Suzuki 2016
NO SCREEN ROTATIONS 10 — © Toshihiro Suzuki 2016
WHICH IS GREAT. 11 — © Toshihiro Suzuki 2016
TODAY I WILL SHARE > our daily development and codebase.
> tvOS specific topics > Readability tips 12 — © Toshihiro Suzuki 2016
PROJECT ! 13 — © Toshihiro Suzuki 2016
THE APP > is kind of like Netflix. > Already
available on iOS/Android, AndroidTV, TVs > We're middle of development. We're not the owner of the service. 14 — © Toshihiro Suzuki 2016
DAILY DEVELOPMENT 15 — © Toshihiro Suzuki 2016
LIBRARY 16 — © Toshihiro Suzuki 2016
CARTHAGE $ cat Cartfile github "rs/SDWebImage" "master" github "toshi0383/TVMLKitchen" github
"cbpowell/MarqueeLabel-Swift" github "duemunk/Async" github "ReactiveX/RxSwift" github "ikesyo/Himotoki" github "ishkawa/APIKit" ~> 1.3 github "realm/realm-cocoa" github "radex/SwiftyUserDefaults" "master" github "malcommac/SwiftDate github "AliSoftware/OHHTTPStubs" I checkin Carthage/Build/tvOS to repo. ! git history data gets larger " Build is fast 17 — © Toshihiro Suzuki 2016
OTHER LIBRARIES > inamiy/DebugLog > Fabric (Crashlytics) > DRM Manager
SDK (Static Library written in C) 18 — © Toshihiro Suzuki 2016
SWIFTLINT FOR CODE FORMATTING 19 — © Toshihiro Suzuki 2016
SWIFTGEN FOR CODE GENERATING 20 — © Toshihiro Suzuki 2016
TESTING ! 21 — © Toshihiro Suzuki 2016
PLAIN XCTEST > runs on Bitrise on every git-push >
mostly tests for models > couple of async test > No UITests any more (we've quit) 22 — © Toshihiro Suzuki 2016
OHHTTPSTUBS 23 — © Toshihiro Suzuki 2016
TEST FAILS ❌ 24 — © Toshihiro Suzuki 2016
You might get unwanted assertionFailure() caused by server API response.
25 — © Toshihiro Suzuki 2016
SOLUTION /// Calls assertionFailure unless isRunningTests() is true /// This
is useful in such case like when /// unstable API causes UITests failure. (which happens like always...) /// - parameter msg: func assertionError(msg: String = "") { if !isRunningTests() { assertionFailure(msg) } } 26 — © Toshihiro Suzuki 2016
ISRUNNINGTESTS() /// Detects if app is running xctest /// -
returns: true if running xctest func isRunningTests() -> Bool { let env = NSProcessInfo.processInfo().environment - if let path = env["XCInjectBundle"] { // Xcode7.2 - return NSString(string: path).pathExtension == "xctest" - } + if let _ = env["XCTestConfigurationFilePath"] { // Xcode7.3 + return true + } if let _ = env["UITest"] { return true } return false } 27 — © Toshihiro Suzuki 2016
"UITEST" ENV VARIABLE /// HogeUITests.swift func setup() { ... let
app = XCUIApplication() app.launchEnvironment["UITest"] = "" 28 — © Toshihiro Suzuki 2016
BETA DISTRIBUTING ! 29 — © Toshihiro Suzuki 2016
30 — © Toshihiro Suzuki 2016
TVOS IS NOT SUPPORTED. 31 — © Toshihiro Suzuki 2016
32 — © Toshihiro Suzuki 2016
MAKEFILE TEST_DESTINATION=-destination "platform=tvOS Simulator,name=Apple TV 1080p,OS=latest" TEST=xcodebuild $(XCODEFLAGS) -scheme $(SCHEME)
clean test $(TEST_DESTINATION) .PHONY: test beta release archive clean ipa-beta ipa ship test: set -o pipefail $(TEST) 33 — © Toshihiro Suzuki 2016
MAKEFILE archive: ./script/check-xcode-version.sh if [ $? -ne 0 ];then exit
1;fi ./script/prepare_for_release.sh if [ ! -d $(BUILD_DIR)/script ];then mkdir -p $(BUILD_DIR)/script;fi xcodebuild -project $(PROJECT).xcodeproj -scheme $(SCHEME) \ -destination "generic/platform=tvOS" \ -xcconfig ./config/App-tvOS.xcconfig \ -archivePath $(ARCHIVE_PATH) \ PROVISIONING_PROFILE=$(PROVISIONING_PROFILE) \ -verbose \ archive | xcpretty --color ipa: xcodebuild -exportArchive -archivePath $(ARCHIVE_PATH) -exportPath $(BUILD_DIR) \ -exportOptionsPlist $(EXPORT_OPTION_PLIST) \ PROVISIONING_PROFILE=$(PROVISIONING_PROFILE) \ -destination "generic/platform=tvOS" 34 — © Toshihiro Suzuki 2016
35 — © Toshihiro Suzuki 2016
TVOS IS NOT SUPPORTED. 36 — © Toshihiro Suzuki 2016
GITHUB RELEASE PAGE fastlane ios upload ipa:$(IPA_PATH) My boss will
download this app and hand it to testers and customers. 37 — © Toshihiro Suzuki 2016
HOW TO INSTALL A BETA APP TO DEVICE You always
need a Xcode 38 — © Toshihiro Suzuki 2016
NOTE TVOS APPS CANNOT DISTRIBUTE USING ENTERPRISE PROVISIONING PROFILES 39
— © Toshihiro Suzuki 2016
TVOS SPECIFIC TOPICS > Focus Engine > TopShelf > TVML
> UITabBar << > UITableView << > AVPlayerViewController << 40 — © Toshihiro Suzuki 2016
UITABBAR <UITabBarController: 0x7fb3d5230c70> is trying to set 7 view controllers
when only 5 view controllers are supported on this platform. Any additional view controllers will not be shown. 41 — © Toshihiro Suzuki 2016
UITABLEVIEW 42 — © Toshihiro Suzuki 2016
AVPLAYERVIEWCONTROLLER 43 — © Toshihiro Suzuki 2016
READABILITY TIPS ! 44 — © Toshihiro Suzuki 2016
TIPS #1 USE SWIFTLINT It's good for your health. 45
— © Toshihiro Suzuki 2016
TIPS #2 Use typealias for important types typealias JSON =
[String: AnyObject] typealias ProductId = String typealias GenreId = String struct Product: Decodable { let productId: ProductId? let productQualityType: ProductQuality? 46 — © Toshihiro Suzuki 2016
TIPS #3 WRITE COMMENT, WRITE TESTS You will forget everything
in next week. I guarantee. 47 — © Toshihiro Suzuki 2016
TIPS #4 IT'S OKAY TO CODE IN YOUR LANGUAGE. enum
RequestSortType: Int { case ৽ணॱ = 1, ̑̌Իॱ = 3, ਓؾॱ = 4 } switch sortType { case .৽ணॱ: break case .̑̌Իॱ: break case .ਓؾॱ: break } 48 — © Toshihiro Suzuki 2016
TIPS #5 USE RXSWIFT WHERE NEEDED. func update(force: Bool) ->
Observable<Void> { return Observable.create { observer in guard force || needsUpdate(self, interval: Constants.APIBatchUpdateInterval) else { observer.onCompleted() return AnonymousDisposable{} } let task = self.updateChannel().bindTo(self.updateTitleList) .subscribeCompleted { observer.onCompleted() self.lastSuccessfulUpdate = NSDate() } return AnonymousDisposable{task.dispose()} } } 49 — © Toshihiro Suzuki 2016
WRAP UP I TALKED ABOUT > our daily development and
codebase. > tvOS specific topics > Readability tips 50 — © Toshihiro Suzuki 2016
AGAIN, TVOS IS A NEW PLATFORM. 51 — © Toshihiro
Suzuki 2016
IT'S BEEN GREAT EXPERIENCE TO BE PART OF THIS ECOSYSTEM.
52 — © Toshihiro Suzuki 2016
FEEL FREE TO ASK ME ANY QUESTIONS ABOUT TVOS. 53
— © Toshihiro Suzuki 2016
BTW, IF YOU WANT A TVML AND NATIVE HYBRID TVOS
APP I'VE HEARD OF TVMLKITCHEN. 54 — © Toshihiro Suzuki 2016
THANK YOU ! 55 — © Toshihiro Suzuki 2016