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
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
1k
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.4k
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.7k
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.3k
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
160
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
200
C++でシェーダを書く
fadis
6
4.1k
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
330
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Documentation Writing (for coders)
carmenintech
65
4.4k
How STYLIGHT went responsive
nonsquared
95
5.2k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
Making Projects Easy
brettharned
115
5.9k
Building Your Own Lightsaber
phodgson
103
6.1k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Six Lessons from altMBA
skipperchong
27
3.5k
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