Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Homekit on tvOS
Search
Shingo Tamaki
June 05, 2017
Technology
0
1.3k
Homekit on tvOS
HomeKit frameworkを使ったtvOSアプリ開発を通して学んだ事を簡単にまとめました。
Shingo Tamaki
June 05, 2017
Tweet
Share
More Decks by Shingo Tamaki
See All by Shingo Tamaki
沖縄モバイルアプリ開発勉強会#1
tamaki
0
82
iOSアプリ開発を始めよう
tamaki
0
120
詳解xcresult.pdf
tamaki
0
290
メルペイでのリグレッションテスト自動化推進のこれまでとこれから
tamaki
0
680
What do you want to test with UI Test v2
tamaki
2
840
JPQRによって変わる日本のQRコード決済
tamaki
0
240
What's New in Testing
tamaki
1
58
What do you want to test with UI Test
tamaki
5
1.8k
How to control state in UI Test
tamaki
4
2.5k
Other Decks in Technology
See All in Technology
AGIについてChatGPTに聞いてみた
blueb
0
130
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
3
380
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.6k
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
170
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
940
いざ、BSC討伐の旅
nikinusu
2
780
[CV勉強会@関東 ECCV2024 読み会] オンラインマッピング x トラッキング MapTracker: Tracking with Strided Memory Fusion for Consistent Vector HD Mapping (Chen+, ECCV24)
abemii
0
220
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
0
110
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
470
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
110
信頼性に挑む中で拡張できる・得られる1人のスキルセットとは?
ken5scal
2
530
Featured
See All Featured
KATA
mclloyd
29
14k
The Invisible Side of Design
smashingmag
298
50k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
GitHub's CSS Performance
jonrohan
1030
460k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
Thoughts on Productivity
jonyablonski
67
4.3k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Become a Pro
speakerdeck
PRO
25
5k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Transcript
HomeKit on tvOS
ࣗݾհ
ࣗݾհ ۄ৴ޛ iOS Engineer! tvOSΞϓϦͷ։ൃࠓ͜ͷͷͨΊʹษڧ͠·ͨ͠ɻ झຯ" ిࢠ࡞⚡ ےτϨ$ ΨδΣοτ%
tvOSΞϓϦͷ։ൃํ๏ʹ͍ͭͯ • ΫϥΠΞϯτ/αʔόܕͷΞϓϦέʔγϣϯ (TVML Kit)
tvOSΞϓϦͷ։ൃํ๏ʹ͍ͭͯ • ωΠςΟϒ։ൃ
OrigamiͷtvOSΞϓϦ ΫϥΠΞϯτ/αʔόܕͰߏங͓ͯ͠ΓɺOrigamiͷECͷӾ ཡػೳΛఏڙ͍ͯ͠·͢ɻ
OrigamiͷtvOSΞϓϦ • TVMLͷTemplate͕ECͷίϯςϯπͱϚονͨ͠ • ϥΠϒΞοϓσʔτՄೳͰϦϦʔεͷख͕ؒগͳ͍ • ৽͍͠ϓϥοτϑΥʔϜͷνϟϨϯδ
ͰࠓωΠςΟϒ࣮ ʹؔ࿈ͨ͠Λ͠·͢ ! ͖ͳࣄ͍͍ͯͬͯ͠ݴΘΕͨ͠
ૣtvOSͷΛ ͢Δલʹ...
࠷ۙͷεϚʔτϗʔϜؔ࿈ͷ Alexa
࠷ۙͷεϚʔτϗʔϜؔ࿈ͷ Google Home
࠷ۙͷεϚʔτϗʔϜؔ࿈ͷ SiriεϐʔΧʔʁ
ͳͥ͜ͷΛ͔ͨ͠ͱ ͍͏ͱʁ
HomeKit
HomeKitͱʁ Apple͕ఏڙ͢ΔεϚʔτϗʔϜͷͨΊͷϑϨʔϜϫʔΫɺ HomeKitରԠΛൢച͢ΔʹMFiೝূ͕ඞཁ
AppleTVͷHomeKitʹ͓͚Δׂ • Remote Gateway ϦϞʔτίϯτϩʔϧɺΦʔτϝʔγϣϯ͕ՄೳՄೳ
iOS10 HomeΞϓϦ͕ొ
tvOSʁ
tvOS10 HomeKitରԠ
tvOS10ͷHomeKitରԠͰԿ͕ग़དྷΔ ͷ͔ʁ • HomeKit frameworkͷҰ෦ػೳ͕Մೳʹͳͬͨ • HomeΞϓϦtvOSʹଘࡏ͠ͳ͍
ͳͷͰHomeΞϓϦͲ ͖Λࢼ࡞ग़དྷͳ͍͔ͬ ͯΈͨ
DEMO
tvOSΞϓϦ։ൃͷಛ • ը໘αΠζ • ੍ݶ͞ΕͨετϨʔδ • ύϥϥοΫεΞΠίϯ • ϑΥʔΧε
tvOSΞϓϦ։ൃͷಛ • ը໘αΠζ • ੍ݶ͞ΕͨετϨʔδ • ύϥϥοΫεΞΠίϯ • ϑΥʔΧε ←
!
ϑΥʔΧεΤϯδϯ
tvOSΞϓϦͷ։ൃʹ͍ͭͯ ϑΥʔΧεͱ͍͏֓೦tvOSʹ͔͠ͳ͍ͷͰɺ tvOSΞϓϦ։ൃͷ࠷େͷצॴͰͳ͍͔ͱࢥ͍ͬͯ·͢ɻ αϯϓϧίʔυΛ࡞ͨ࣌͠ʹࢥ͍௨Γʹಈ͔ͳ͔ͬͨέʔε ͱɺͦͷରԠʹ͍ͭͯઆ໌͠·͢ɻ ※ ϫʔΫΞϥϯυͳײ͢͡ΔͷͰͬͱςΫχΧϧͳํ๏ ͕͋Ε୭͔͋ͱͰڭ͍͑ͯͩ͘͞ɻ
ͦͷ1
ࢥ͍௨ΓʹϑΥʔΧεग़དྷͳ͍ ͦͷ1
ࢥ͍௨ΓʹϑΥʔΧεग़དྷͳ͍ ͦͷ1
ࢥ͍௨ΓʹϑΥʔΧεग़དྷͳ͍ ͦͷ1 λϒόʔ͔ΒӈଆͷηϧͷϑΥʔΧεΛېࢭ͢Δ override func shouldUpdateFocus(in context: UIFocusUpdateContext) -> Bool
{ if let prev = context.previouslyFocusedView, String(describing:type(of: prev)) == "UITabBarButton" { return false } return true }
ͦͷ2
ࢥ͍௨ΓʹϑΥʔΧεग़དྷͳ͍ ͦͷ2
ࢥ͍௨ΓʹϑΥʔΧεग़དྷͳ͍ ͦͷ2
UIFocusEnvironment Protocol UIFocusEnvironment ProtocolͷσϦήʔτϝιουͰϑΥʔΧ εΛ͏·͘ίϯτϩʔϧग़དྷΔΑ͏ʹ ࣮͢Δඞཁ͕͋Δɻ var preferredFocusEnvironments: [UIFocusEnvironment] func
shouldUpdateFocus(in context: UIFocusUpdateContext) -> Bool { return ఆॲཧ݁Ռ } override func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) { //ϑΥʔΧε࣌ʹߦ͍͍ͨॲཧ } https://developer.apple.com/reference/uikit/ uifocusenvironment
Debug Quick Look
Debug _whyIsThisViewNotFocusable σόοά࣌ʹ_whyIsThisViewNotFocusableϝιουΛݺͿ͜ ͱͰݪҼͱߟ͑ΒΕΔࣄ߲Λग़ྗͯ͘͠Ε·͢ɻ
Θ͔ͬͨࣄ શͯͷϝιου͕͑ΔΘ͚Ͱͳ͍ addHome(withName homeName: String, completionHandler completion: @escaping (HMHome?, Error?)
-> Void) removeHome(_ home: HMHome, completionHandler completion: @escaping (Error?) -> Void) updatePrimaryHome(HMHome, completionHandler: (Error?) -> Void) Homeͷ࡞ʹݶΒͣɺRoomΞΫηαϦʹ͍ͭͯಉ༷
Θ͔ͬͨࣄ શͯͷϝιου͕͑ΔΘ͚Ͱͳ͍ • ߟ • TVجຊతʹݟΔ͚ͩͰɺૢ࡞͠ͳ͍ࣄ͕ଟ͍(ϦϞί ϯͷૢ࡞ͩΔ͍...)ͨΊɺͦͷػೳ͕আ֎͞Ε͍ͯΔͷͰ !
͓·͚
͋ͳ͕ͨtvOSΞϓϦ ͷ։ൃΛ͢ΔͷͳΒ ग़ઌͰͷ࣮ػσόοάͭΒ͍
͋ͳ͕ͨtvOSΞϓϦͷ։ൃΛ͢Δͷͳ Β
͋ͳ͕ͨtvOSΞϓϦͷ։ൃΛ͢Δͷͳ Β • ࣮ػ(AppleTV)ܞଳੑʹ͍͠ͷͰɺHomeKitͷૢ࡞෦ ͷ։ൃiPhoneͰߦ͑ΔΑ͏ʹͯͨ͠ํ͕ग़ઌͰ։ൃ͠ ͍͢ɻ
γϛϡϨʔλͰྑ͍ͷͰ ʁ!
HomeKitͷDBڞ༗ʹ͍ͭͯ HomeKitͷiCloudʹΑΔDBڞ༗ γϛϡϨʔλͰग़དྷͳ͍
͓Θ͔Γ͍͚ͨͩͨͩΖ ͏͔!?
࣮ػ։ൃΛڧ͍ΒΕΔཧ༝ • HomeKit DBڞ༗࣮ػ͚ͩ • HomeKit FrameworkͰHome/Room/AccesoryͳͲͷ৽ن ొɾআɾฤू͕ग़དྷͳ͍ • ඞવతʹσʔλiCloudܦ༝ͷHomeKit
DBڞ༗པΈͱͳ Δ
Enjoy tvOS App Development
ࢀߟจݙ tvOSΞϓϦέʔγϣϯϓϩάϥϛϯάΨΠυ https://developer.apple.com/jp/documentation/General/ Conceptual/AppleTV_PG/ 2017ͦ͜tvOSΞϓϦ։ൃΛ࢝Ί͍ͨΤϯδχΞ͚ɺUI࣮ ϊϋू https://techblog.yahoo.co.jp/advent-calendar-2016/tvosapp- tips/
ࢀߟจݙ Apple TV – tvOSೖ – https://developers.cyberagent.co.jp/blog/archives/3642/ UIKitCatalogͷαϯϓϧίʔυ͔ΒtvOSͷϑΥʔΧεΛֶͿ http://qiita.com/hanawat/items/a2542df65e0534979cb0 ϚωʔϑΥϫʔυͷtvOSΞϓϦέʔγϣϯΛ։ൃͨ͠
https://moneyforward.com/engineers_blog/2016/02/26/ moneyforward-tvos/
Ҏ্