Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
TCAでのClient/Managerの 利用パターンでは副作用のActionやErrorを分離できる
yimajo
November 22, 2020
Programming
0
420
TCAでのClient/Managerの 利用パターンでは副作用のActionやErrorを分離できる
iOSアプリ開発のためのFunctional Architecture情報共有会2 の発表資料です。
https://connpass.com/event/194239/
yimajo
November 22, 2020
Tweet
Share
More Decks by yimajo
See All by yimajo
TCA v0.19.0からのSwitchStore/CaseLetが良い
yimajo
0
820
TCAでViewStoreにKeyPath DynamicMemberLookupが使われてる件
yimajo
0
500
【開催説明資料】iOSアプリ開発のための Functional Architecture 情報共有会
yimajo
0
95
SWORD ART COMBINE
yimajo
1
680
iOSアプリ開発のためのThe Composable Architectureがすごく良いので紹介したい
yimajo
5
2.7k
iOS CleanArchitecture 勉強会用の開会前資料
yimajo
0
58
クリーンアーキテクチャとiOSアプリ開発のためのVIPERと
yimajo
0
330
RxSwift - Resolution of TestScheduler
yimajo
1
950
RxSwiftでエラーを分岐するTips
yimajo
8
1.3k
Other Decks in Programming
See All in Programming
Isar勉強会
hoddy3190
0
300
Rust、何もわからない...#3
estie
0
140
Enzyme から React Native Testing Library に移行した経緯 / 2022-07-20
tamago3keran
1
160
Rに管理されてみる
kazutan
0
250
リーダブルテストコード / #vstat
jnchito
46
34k
「困りごと」から始める個人開発
ikumatadokoro
4
240
SwiftUI+TCAに挑戦!NewsPicks iOSアプリのリアーキテクチャ/re-architecture-newspicks-ios-app-with-swiftui-and-tca
takehilo
0
360
パラメタライズドテスト
ledsun
0
220
ふんわり理解するcontext
rukiadia
1
170
クラウド KMS の活用 / TOKYO BLOCKCHAIN TECH MEETUP 2022
odanado
PRO
0
180
企業内スモールデータでのデータ解析
hamage9
0
850
読みやすいコード クラスメソッド 2022 年度新卒研修
januswel
0
2.9k
Featured
See All Featured
The Cult of Friendly URLs
andyhume
68
4.8k
KATA
mclloyd
7
8.8k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
14
3.8k
The Brand Is Dead. Long Live the Brand.
mthomps
46
2.7k
A Philosophy of Restraint
colly
192
15k
A designer walks into a library…
pauljervisheath
196
16k
The Web Native Designer (August 2011)
paulrobertlloyd
75
2k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
349
27k
Documentation Writing (for coders)
carmenintech
48
2.6k
It's Worth the Effort
3n
172
26k
Fashionably flexible responsive web design (full day workshop)
malarkey
396
62k
No one is an island. Learnings from fostering a developers community.
thoeni
9
1.3k
Transcript
TCAͰͷClient/Managerͷ ར༻ύλʔϯͰ෭࡞༻ͷ ActionErrorΛͰ͖Δ iOSΞϓϦ։ൃͷͨΊͷFunctional Architectureใڞ༗ձ2 @yimajo 2020/11/22 #fa_ios
The Composable Architecture ʹ ಛఆͷ෭࡞༻Λ·ͱΊΔΧελϜͳ Client/Managerܕͷαϯϓϧ͕͋Δ
• DownloadClient • WebSocketClient • LocalSearchClient • WeatherClient • SpeechClient
• AuthenticationClient • AudioPlayerClient • AudioRecorderClient • MotionManager • LocationManager
State Action View Store DI Environment Client Effect Reducer Error
"DUJPO
State Action View Store DI Environment Client Effect Reducer Error
"DUJPO
State Action View Store DI Environment Client Effect Reducer Error
"DUJPO
State Action View Store DI Environment Client Effect Reducer Error
"DUJPO
State Action View Store DI Environment Client Effect Reducer Error
"DUJPO
State Action View Store DI Environment Client Effect Reducer Error
"DUJPO
State Action View Store DI Environment Client Effect Reducer Error
"DUJPO
Clientͷߏ
෭࡞༻࣮ߦΫϩʔδϟ ઐ༻ͷΤϥʔ ઐ༻ͷ"DUJPO
$MJFOUͷ࣮ߦΛอ࣋͢Δ %FQFOEFODJFT
TUBUJDMFUMJWFͰγϯάϧτϯతͳΠϯλϑΣʔε ෭࡞༻࣮ߦΫϩʔδϟDBODFMͷఆٛ ෭࡞༻࣮ߦΫϩʔδϟEPXOMPBEͷఆٛ
MJWFͷݺͼग़͠&OWJSPONFOUͰ lMJWFzͷݴ༿ͷҙຯΑ͘Θ͔Βͳ͍ QSFWJFXʹMJWF͏ͷͰຊ൪༻ͬͯҙຯͰͳ͍ MJWF/VNCFS'BDU GPS ͳͲ୯ʹ௨৴͢Δ͚ͩɻ ࢹͳͲΛ͍ͯ͠ΔΘ͚Ͱͳ͍ɻ GBWPSJUF JEJT'BWPSJUF BTZOD"GUFSͳͷͰඇಉظॲཧ
Clientͷ෭࡞༻࣮ߦΫϩʔδϟͷ ݺͼग़͠
෭࡞༻࣮ߦΫϩʔδϟEPXOMPBEͷ࣮ߦ
ཧ۶ͱͯ͠ɺ$PSF.PUJPOͷ TUBSU%FWJDF.PUJPO6QEBUFT VTJOH UP ͜ΕͷϞʔγϣϯΛݕ͢Δͱಈ࡞͢ΔΫϩʔδϟɻ ͜ͷ෭࡞༻࣮ߦΫϩʔδϟ֎෦͔ΒݺΕͣɺ ෦Ͱ4VCTDSJCFS͕ΠϕϯτΛTFOEͯ͘͠ΕΔɻ
෭࡞༻࣮ߦΫϩʔδϟͷ෦ݺͼग़͠ • ࣗಈͰԿ͔Λࢹͯ͠มԽ͕͋ͬͨΒAction͕ݺͼग़ͤΔ • Motion • Location • Core DataͷFetch
Result Controller
%PXOMPBE$MJFOUͷ"DUJPOΛ3FEVDFSʹ͑Δ
·ͱΊ • Action/ErrorΛݸผʹఆٛ • ෭࡞༻࣮ߦΫϩʔδϟ • ΫϩʔδϟΛReducer͕֎෦ݺͼग़͠ • Ϋϩʔδϟ෦Ͱউखʹ࣮ߦͤͨ͞Γ