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
TCAでのClient/Managerの 利用パターンでは副作用のActionやErrorを分...
Search
yimajo
November 22, 2020
Programming
0
900
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
400
11年かかって やっとVibe Codingに 時代が追いつきましたね
yimajo
1
300
iOSアプリ開発で 関数型プログラミングを実現する The Composable Architectureの紹介
yimajo
2
260
良いテストコードのために悪いテストコードを理解する - 不安定なテスト編: iOSアプリ開発ユニットテストの場合
yimajo
22
6.3k
TCAの Shared Stateって どういう仕組みになってんの?
yimajo
0
2.3k
Swift 5.9 からの Observation はiOS17 未満 からも使えて struct の変更検知もできるんすかね?
yimajo
2
1k
不安定なテストは200種類あんねん
yimajo
3
1k
TCA v0.19.0からのSwitchStore/CaseLetが良い
yimajo
0
1.9k
TCAでViewStoreにKeyPath DynamicMemberLookupが使われてる件
yimajo
0
1.2k
Other Decks in Programming
See All in Programming
Six and a half ridiculous things to do with Quarkus
hollycummins
0
170
詳しくない分野でのVibe Codingで困ったことと学び/vibe-coding-in-unfamiliar-area
shibayu36
3
4.9k
なぜあの開発者はDevRelに伴走し続けるのか / Why Does That Developer Keep Running Alongside DevRel?
nrslib
3
400
Goで実践するドメイン駆動開発 AIと歩み始めた新規プロダクト開発の現在地
imkaoru
4
820
CI_CD「健康診断」のススメ。現場でのボトルネック特定から、健康診断を通じた組織的な改善手法
teamlab
PRO
0
210
私達はmodernize packageに夢を見るか feat. go/analysis, go/ast / Go Conference 2025
kaorumuta
2
530
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
190
XP, Testing and ninja testing ZOZ5
m_seki
3
620
Devvox Belgium - Agentic AI Patterns
kdubois
1
120
Domain-centric? Why Hexagonal, Onion, and Clean Architecture Are Answers to the Wrong Question
olivergierke
2
820
Your Perfect Project Setup for Angular @BASTA! 2025 in Mainz
manfredsteyer
PRO
0
160
After go func(): Goroutines Through a Beginner’s Eye
97vaibhav
0
370
Featured
See All Featured
A Tale of Four Properties
chriscoyier
161
23k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
The Pragmatic Product Professional
lauravandoore
36
6.9k
Rails Girls Zürich Keynote
gr2m
95
14k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Typedesign – Prime Four
hannesfritz
42
2.8k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
114
20k
Building Better People: How to give real-time feedback that sticks.
wjessup
369
20k
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͕֎෦ݺͼग़͠ • Ϋϩʔδϟ෦Ͱউखʹ࣮ߦͤͨ͞Γ