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
SwiftUIを導入したアプリ設計
Search
Yu Tawata
September 21, 2020
Programming
4
2.7k
SwiftUIを導入したアプリ設計
iOSDC Japan 2020での登壇資料です
Yu Tawata
September 21, 2020
Tweet
Share
More Decks by Yu Tawata
See All by Yu Tawata
try! Serverless App with Swift
yuta24
2
520
再利用可能なUI Componentsを利用したアプリ開発
yuta24
12
3.3k
Wantedly Peopleの連絡先一覧について
yuta24
1
5.5k
Wantedly Peopleがたどり着いたアーキテクチャ
yuta24
1
5k
Other Decks in Programming
See All in Programming
BEエンジニアがFEの業務をできるようになるまでにやったこと
yoshida_ryushin
0
190
return文におけるstd::moveについて
onihusube
1
1.4k
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
120
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
3
2.1k
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
240
技術的負債と向き合うカイゼン活動を1年続けて分かった "持続可能" なプロダクト開発
yuichiro_serita
0
300
PicoRubyと暮らす、シェアハウスハック
ryosk7
0
200
オニオンアーキテクチャを使って、 Unityと.NETでコードを共有する
soi013
0
370
Rubyでつくるパケットキャプチャツール
ydah
0
160
ecspresso, ecschedule, lambroll を PipeCDプラグインとして動かしてみた (プロトタイプ) / Running ecspresso, ecschedule, and lambroll as PipeCD Plugins (prototype)
tkikuc
2
1.8k
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
770
ATDDで素早く安定した デリバリを実現しよう!
tonnsama
1
1.8k
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
34
1.6k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
For a Future-Friendly Web
brad_frost
176
9.5k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
4 Signs Your Business is Dying
shpigford
182
22k
It's Worth the Effort
3n
183
28k
KATA
mclloyd
29
14k
Measuring & Analyzing Core Web Vitals
bluesmoon
5
210
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
173
51k
Building an army of robots
kneath
302
45k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Transcript
Yu Tawata, 2020/9/21 SwiftUIΛಋೖͨ͠ΞϓϦઃܭ iOSDC Japan 2020
ࣗݾհ • Yu Tawata • iOS Engineer • Twitter: yuta24
• Joined DMM at 2019
None
ΞδΣϯμ • ઃܭͷඪ • SwiftUI • ՝ • ݕূ •
ΞʔΩςΫνϟ • ϑϩʔ • ·ͱΊ
ઃܭͷඪ • ੜ࢈ੑ • Ϗϧυ࣌ؒ • ࣮ίετ • UI •
σΟʔϓϦϯΫ • ςετ༰қੑ • Ϣχοτςετ • εφοϓγϣοτςετ
ઃܭͷඪ • ੜ࢈ੑ • Ϗϧυ࣌ؒ • ࣮ίετ • UI •
σΟʔϓϦϯΫ • ςετ༰қੑ • Ϣχοτςετ • εφοϓγϣοτςετ ϚϧνϑϨʔϜϫʔΫ SwiftUI Coordinator DI ViewState
None
SwiftUI • ओͳಛ • એݴతʹUIΛهड़Ͱ͖Δ • ࣮ࡍͷΞϓϦΛಈ࡞ͤͯ͞୯ҰViewΛPreviewͰ͖Δ • શͯͷAppleϓϥοτϑΥʔϜ্Ͱར༻Ͱ͖Δ •
ޓੑ • SwiftUI্ʹUIKitͷViewΛՃՄೳ • UIKitͷViewʹSwiftUIͷViewΛՃՄೳ
બࢶ 1. SwiftUIΛϕʔεʹ࣮͠ɺUIKitΛҰ෦Ͱར༻͢Δ 2. UIKitΛϕʔεʹ࣮͠ɺSwiftUIΛҰ෦Ͱར༻͢Δ 3. UIKitͷΈͰ࣮͢Δ
બࢶ 1. SwiftUIΛϕʔεʹ࣮͠ɺUIKitΛҰ෦Ͱར༻͢Δ 2. UIKitΛϕʔεʹ࣮͠ɺSwiftUIΛҰ෦Ͱར༻͢Δ 3. UIKitͷΈͰ࣮͢Δ
ߟྀ͖͢ཁ݅ • ػೳ • Χϧʔηϧදࣔ • ෳͷΞϓϦىಈܦ࿏ • ඇػೳ •
จࣈ০ • ΞφϦςΟΫε • ը໘ભҠ • Ϙλϯλοϓ • ίϯόʔδϣϯ • ΫϥογϡϝτϦΫε • ύϑΥʔϚϯεϞχλϦϯά
• ػೳ • Χϧʔηϧදࣔ • ෳͷΞϓϦىಈܦ࿏ • ඇػೳ • จࣈ০
• ΞφϦςΟΫε • ը໘ભҠ • Ϙλϯλοϓ • ίϯόʔδϣϯ • ΫϥογϡϝτϦΫε • ύϑΥʔϚϯεϞχλϦϯά ߟྀ͖͢ཁ݅
ෳͷΞϓϦىಈܦ࿏ • UIKitͷ߹ • Coordinatorύλʔϯ • SwiftUIͷ߹ • ʁʁʁʁ
UIKitͷ߹ - Coordinator • ը໘ભҠॲཧΛVC͔Β CoordinatorʹҠৡ͢Δ • VCؒͷґଘΛૄʹ͢ΔσβΠϯ ύλʔϯ
UIKitͷ߹ - Coordinator AppCoordinator AuthCoordinator MainCoordinator
UIKitͷ߹ - Coordinator AppCoordinator AuthCoordinator MainCoordinator
UIKitͷ߹ - Coordinator AppCoordinator AuthCoordinator MainCoordinator
UIKitͷ߹ - Coordinator AppCoordinator AuthCoordinator MainCoordinator Coordinator͕ը໘ભҠΛߦ͏
SwiftUIͷ߹ -ʁʁʁʁ • ϓογϡ • Ϟʔμϧ
SwiftUIͷ߹ -ʁʁʁʁ • ٻΊΒΕΔ࣮ • બͨ͠ใΛड͠Ͱ͖Δ • ذ݅Λ͚ͭΒΕΔ • View͔ΒͷΠϕϯτୡ
τϥοΩϯάʔը໘ભҠ • UIKitͷ߹ • Google Analytics for Firebase • SwiftUIͷ߹
• ʁʁʁʁ
UIKitͷ߹ - Google Analytics for Firebase
SwiftUIͷ߹ -ʁʁʁʁ
None
UIHostingController UITabBarController UIHostingController UINavigationController DestinationHostingController
UIHostingController UITabBarController UIHostingController UINavigationController DestinationHostingController Analyticsʹ͍ͣΕͷViewControllerͷ σʔλه͞Ε͍ͯͳ͔ͬͨ
SwiftUIͷ߹ -ʁʁʁʁ
બࢶ 1. SwiftUIΛϕʔεʹ࣮͠ɺUIKitΛҰ෦Ͱར༻͢Δ 2. UIKitΛϕʔεʹ࣮͠ɺSwiftUIΛҰ෦Ͱར༻͢Δ 3. UIKitͷΈͰ࣮͢Δ
બࢶ 1. SwiftUIΛϕʔεʹ࣮͠ɺUIKitΛҰ෦Ͱར༻͢Δ 2. UIKitΛϕʔεʹ࣮͠ɺSwiftUIΛҰ෦Ͱར༻͢Δ 3. UIKitͷΈͰ࣮͢Δ Ͳͷ໘Ͱ׆༻Ͱ͖Δʁ
ݕূ 1. UIViewʹSwiftUIΛར༻͢Δ 2. UITableViewʹSwiftUIΛར༻͢Δ 3. UICollectionViewʹSwiftUIΛར༻͢Δ
ݕূ 1. UIViewʹSwiftUIΛར༻͢Δ 2. UITableViewʹSwiftUIΛར༻͢Δ 3. UICollectionViewʹSwiftUIΛར༻͢Δ
UITableViewʹSwiftUIΛར༻͢Δ
None
ݕূ 1. UIViewʹSwiftUIΛར༻͢Δ 2. UITableViewʹSwiftUIΛར༻͢Δ • HostingTableViewCellͰҙͷSwiftUIͷViewΛදࣔͰ͖Δ • Self-SizingʹରԠͰ͖Δ 3.
UICollectionViewʹSwiftUIΛར༻͢Δ • HostingCollectionViewCellͰҙͷSwiftUIͷViewΛදࣔͰ͖Δ • Self-SizingʹରԠͰ͖Δ
બࢶ 1. SwiftUIΛϕʔεʹ࣮͠ɺUIKitΛҰ෦Ͱར༻͢Δ 2. UIKitΛϕʔεʹ࣮͠ɺSwiftUIΛҰ෦Ͱར༻͢Δ 3. UIKitͷΈͰ࣮͢Δ
ΞʔΩςΫνϟ Domain Core Feature Feature Feature UI App
View View Interactor Interactor ϑϩʔ ViewController Presenter Interactor Coordinator UIView
or View Repository
·ͱΊ • • SwiftUIը໘ભҠϩδοΫΛ؆୯ʹണ͕ͤͳ͍ • SwiftUI࣌ͷ࣮ύλʔϯ͕ඞཁʹͳΔʢ͔͠Εͳ͍ʁʣ • SwiftUIैདྷAnalyticsπʔϧͰը໘ભҠΛτϥοΩϯάͰ͖ͳ͍ •
ରԠࡦ • UIKitΛϕʔεʹΞϓϦΛઃܭ • SwiftUIΛUIίϯϙʔωϯτͱͯ͠࠾༻
ࢀߟ https://developer.apple.com/videos/play/wwdc2020/10119/ https://khanlou.com/2015/10/coordinators-redux/ https://firebase.google.com/docs/analytics/screenviews?hl=ja https://jobandtalent.engineering/ios-architecture-an-state-container-based- approach-4f1a9b00b82e