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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
yimajo
November 22, 2020
Programming
1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TCAでのClient/Managerの 利用パターンでは副作用のActionやErrorを分離できる
iOSアプリ開発のためのFunctional Architecture情報共有会2 の発表資料です。
https://connpass.com/event/194239/
yimajo
November 22, 2020
More Decks by yimajo
See All by yimajo
片田舎のおっさん、 Swift Buildのダイアモンド問題解決の不具合修正PRを出すが、解決方法がキャッシュをしないようにすることであり、ビルド時間が伸びると言われてマージされないので高速化もする/swiftbuild
yimajo
0
300
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
900
いま中途半端なSwift 6対応をするより、Default ActorやApproachable Concurrencyを有効にしてからでいいんじゃない?
yimajo
2
720
11年かかって やっとVibe Codingに 時代が追いつきましたね
yimajo
1
400
iOSアプリ開発で 関数型プログラミングを実現する The Composable Architectureの紹介
yimajo
3
340
良いテストコードのために悪いテストコードを理解する - 不安定なテスト編: iOSアプリ開発ユニットテストの場合
yimajo
22
6.8k
TCAの Shared Stateって どういう仕組みになってんの?
yimajo
0
2.7k
Swift 5.9 からの Observation はiOS17 未満 からも使えて struct の変更検知もできるんすかね?
yimajo
2
1.2k
不安定なテストは200種類あんねん
yimajo
3
1.2k
Other Decks in Programming
See All in Programming
リアルな遅延を測る仕様
kota_yata
1
130
Oxlintはいいぞ(続)
yug1224
1
470
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
110
仕様書を書く前にハーネスを作る - Agent Native開発は「探索を速く、判定を固く」
gotalab555
5
1.8k
Flow は今どうなっているか
mizdra
PRO
0
750
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
260
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
270
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
170
ソフトウェアラスタライザ
fadis
1
700
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
230
freeeにおけるEvalsの実践例の紹介
freee
PRO
0
150
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
250
Featured
See All Featured
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
280
Agile that works and the tools we love
rasmusluckow
331
22k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
380
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.3k
Speed Design
sergeychernyshev
33
2k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
500
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
290
Automating Front-end Workflow
addyosmani
1369
210k
A Tale of Four Properties
chriscoyier
163
24k
Odyssey Design
rkendrick25
PRO
2
780
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.1k
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͕֎෦ݺͼग़͠ • Ϋϩʔδϟ෦Ͱউखʹ࣮ߦͤͨ͞Γ