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
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
Content Security Policy入門 セキュリティ設定と 違反レポートのはじめ方 / Introduction to Content Security Policy Getting Started with Security Configuration and Violation Reporting
uskey512
1
490
讓數據說話:用 Python、Prometheus 和 Grafana 講故事
eddie
0
390
CSC509 Lecture 12
javiergs
PRO
0
140
Quine, Polyglot, 良いコード
qnighy
4
630
as(型アサーション)を書く前にできること
marokanatani
4
740
Macとオーディオ再生 2024/11/02
yusukeito
0
350
CSC509 Lecture 09
javiergs
PRO
0
140
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
210
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.2k
PLoP 2024: The evolution of the microservice architecture pattern language
cer
PRO
0
2.5k
Better Code Design in PHP
afilina
PRO
0
120
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.2k
Featured
See All Featured
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Product Roadmaps are Hard
iamctodd
PRO
49
11k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
700
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Facilitating Awesome Meetings
lara
50
6.1k
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5.2k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
7
570
Large-scale JavaScript Application Architecture
addyosmani
510
110k
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