$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
TCAでのClient/Managerの 利用パターンでは副作用のActionやErrorを分...
Search
yimajo
November 22, 2020
Programming
0
920
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
いま中途半端なSwift 6対応をするより、Default ActorやApproachable Concurrencyを有効にしてからでいいんじゃない?
yimajo
2
530
11年かかって やっとVibe Codingに 時代が追いつきましたね
yimajo
1
310
iOSアプリ開発で 関数型プログラミングを実現する The Composable Architectureの紹介
yimajo
2
280
良いテストコードのために悪いテストコードを理解する - 不安定なテスト編: iOSアプリ開発ユニットテストの場合
yimajo
22
6.4k
TCAの Shared Stateって どういう仕組みになってんの?
yimajo
0
2.3k
Swift 5.9 からの Observation はiOS17 未満 からも使えて struct の変更検知もできるんすかね?
yimajo
2
1k
不安定なテストは200種類あんねん
yimajo
3
1.1k
TCA v0.19.0からのSwitchStore/CaseLetが良い
yimajo
0
2k
TCAでViewStoreにKeyPath DynamicMemberLookupが使われてる件
yimajo
0
1.2k
Other Decks in Programming
See All in Programming
connect-python: convenient protobuf RPC for Python
anuraaga
0
350
ID管理機能開発の裏側 高速にSaaS連携を実現したチームのAI活用編
atzzcokek
0
160
AIコードレビューがチームの"文脈"を 読めるようになるまで
marutaku
0
260
乱雑なコードの整理から学ぶ設計の初歩
masuda220
PRO
32
15k
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
1
300
GeistFabrik and AI-augmented software development
adewale
PRO
0
230
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
4
1.8k
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
380
How Software Deployment tools have changed in the past 20 years
geshan
0
27k
Integrating WordPress and Symfony
alexandresalome
0
110
Building AI Agents with TypeScript #TSKaigiHokuriku
izumin5210
5
1.2k
Evolving NEWT’s TypeScript Backend for the AI-Driven Era
xpromx
0
250
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Scaling GitHub
holman
464
140k
Statistics for Hackers
jakevdp
799
230k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
How to train your dragon (web standard)
notwaldorf
97
6.4k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
Rails Girls Zürich Keynote
gr2m
95
14k
Six Lessons from altMBA
skipperchong
29
4.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
Optimizing for Happiness
mojombo
379
70k
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͕֎෦ݺͼग़͠ • Ϋϩʔδϟ෦Ͱউखʹ࣮ߦͤͨ͞Γ