$30 off During Our Annual Pro Sale. View Details »
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
510
再利用可能な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
TypeScript でバックもやるって実際どう? 実運用で困ったこと3選
yuichiro_serita
17
7.5k
Functional Event Sourcing using Sekiban
tomohisa
0
130
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
3.3k
距離関数を極める! / SESSIONS 2024
gam0022
0
360
社内活動の取り組み紹介 ~ スリーシェイクでこんな取り組みしてます ~
bells17
0
380
[FlutterKaigi2024] Effective Form 〜Flutterによる複雑なフォーム開発の実践〜
chocoyama
0
3.9k
N.E.X.T LEVEL
pluu
2
250
as(型アサーション)を書く前にできること
marokanatani
10
3k
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2.3k
PaaSとSaaSの境目で信頼性と開発速度を両立する 〜TROCCO®︎のこれまでとこれから〜
gtnao
6
6.1k
.NET Conf 2024の振り返り
tomokusaba
0
190
Modular Monolith Monorepo ~シンプルさを保ちながらmonorepoのメリットを最大化する~
yuisakamoto
10
3.8k
Featured
See All Featured
Optimizing for Happiness
mojombo
376
70k
The World Runs on Bad Software
bkeepers
PRO
65
11k
A designer walks into a library…
pauljervisheath
204
24k
Why Our Code Smells
bkeepers
PRO
334
57k
Embracing the Ebb and Flow
colly
84
4.5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
YesSQL, Process and Tooling at Scale
rocio
169
14k
For a Future-Friendly Web
brad_frost
175
9.4k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.2k
Automating Front-end Workflow
addyosmani
1366
200k
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