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.2k
Wantedly Peopleの連絡先一覧について
yuta24
1
5.5k
Wantedly Peopleがたどり着いたアーキテクチャ
yuta24
1
5k
Other Decks in Programming
See All in Programming
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
360
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
7
1.3k
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
100
Androidアプリのモジュール分割における:x:commonを考える
okuzawats
1
140
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
220
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.3k
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
190
命名をリントする
chiroruxx
1
420
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
210
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
140
Featured
See All Featured
How to Ace a Technical Interview
jacobian
276
23k
How GitHub (no longer) Works
holman
311
140k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
How STYLIGHT went responsive
nonsquared
95
5.2k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Statistics for Hackers
jakevdp
796
220k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
How to train your dragon (web standard)
notwaldorf
88
5.7k
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