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
iOS de Redux
Search
木藤紘介/Kosuke Kito
April 17, 2018
Programming
1
85
iOS de Redux
2018/04/13
社内他職種エンジニア向けLT
木藤紘介/Kosuke Kito
April 17, 2018
Tweet
Share
More Decks by 木藤紘介/Kosuke Kito
See All by 木藤紘介/Kosuke Kito
Flutter with Redux
kitoko552
3
1.1k
Other Decks in Programming
See All in Programming
Hanami and htmx
bkuhlmann
0
210
Elm Form Validation
bkuhlmann
0
510
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
180
AWS Application Composerで始める、 サーバーレスなデータ基盤構築 / 20240406-jawsug-hokuriku-shinkansen
kasacchiful
1
260
Designing for tomorrow's programming workflows
honnibal
PRO
2
120
Blue/Greenデプロイの導入による 運用フローの改善
kudoas
1
370
今、知っておきたい! 生成AIエージェントの世界
elith
3
350
PHP8.3の機能を振り返る / Review of PHP 8.3 features
seike460
PRO
1
110
Changed Rules: Architectures with Lightweight Stores
manfredsteyer
PRO
0
240
Elm 0.19.0 Changes
bkuhlmann
0
490
二郎系ラーメンのコールで学ぶ AST 解析
memory1994
PRO
7
1.7k
try! Swift Tokyo 初参加報告LT
hinakko2
0
220
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
175
21k
Designing with Data
zakiwarfel
96
4.8k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
125
32k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
Optimizing for Happiness
mojombo
370
69k
A designer walks into a library…
pauljervisheath
200
23k
Building Better People: How to give real-time feedback that sticks.
wjessup
355
18k
Atom: Resistance is Futile
akmur
259
25k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
18
6.9k
Designing for Performance
lara
601
67k
Done Done
chrislema
178
15k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
357
22k
Transcript
iOS de Redux Kosuke Kito
Kosuke Kito ͍͖ͳΓεςʔΩΰʔϧυձһ
Redux
Fluxͷ֦ு
Flux???
άάϨΧε
- Single source of truth - State is read-only -
Mutations are written as pure function Redux three principles
Single source truth ΞϓϦέʔγϣϯશମͷঢ়ଶΛ ͭͷΦϒδΣΫτπϦʔʢ4UPSFʣ Ͱදݱ͢ΔΑʂ
State is read-only 4UBUFಡΈऔΓઐ༻ͩΑʂ ঢ়ଶΛม͍͑ͨ߹"DUJPOΛൃߦͯ͠Ͷʂ
Mutations are written as pure function ঢ়ଶมߋʹ७ਮؔʢ3FEVDFSʣΛ͓͏Ͷʂ 3FEVDFS"DUJPOͱ4UBUFΛड͚औͬͯ ৽͍͠4UBUFΛฦ͢Αʂ
https://qiita.com/susieyy/items/23d44f28c6a6915c58e2
iOSͰ࠾༻͢Δʹʁ
ReSwift https://github.com/ReSwift/ReSwift
None
͜Ε͚ͩ
Action
public protocol Action { }
public protocol Action { } ͜Ε͚ͩ
State
public protocol StateType { }
public protocol StateType { } ͜Ε͚ͩ
Reducer
public typealias Reducer<ReducerStateType> = (_ action: Action, _ state: ReducerStateType?)
-> ReducerStateType
public typealias Reducer<ReducerStateType> = (_ action: Action, _ state: ReducerStateType?)
-> ReducerStateType ͜Ε͚ͩ
ReSwiftجຊతʹ ΈΛఏڙ͢Δ͚ͩ ※Store͔ͬ͠Γॻ͔Εͯ·͢
͖
͕ɺ
ݒ೦
- ࠩߋ৽ͭΒ͍ - Stateͷ௨Λड͚औΔͨΊʹView͝ͱʹ Delegate४ڌͤ͞ΔͷͭΒ͍ ݒ೦
- ࠩߋ৽ͭΒ͍ => IGListKit or RxDataSources - Stateͷ௨Λड͚औΔͨΊʹView͝ͱʹ Delegate४ڌͤ͞ΔͷͭΒ͍ =>
RxSwift ݒ೦
None
- ͦΕͧΕͷΫϥεͷ͕໌͔֬ͭ΄ͲΑ͍αΠζ Ͱ͖ - ݫ͗͢͠ͳ͍΄ͲΑ͍ϧʔϧ͕͖ - ୯Ұํͷσʔλϑϩʔ͖ - iOSͳΒͰͷݒ೦ϥΠϒϥϦͰΧόʔͰ͖Δ͖ ײ
͖