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.2k
Other Decks in Programming
See All in Programming
CNCF Project の作者が考えている OSS の運営
utam0k
6
710
[Fin-JAWS 第38回 ~re:Invent 2024 金融re:Cap~]FaultInjectionServiceアップデート@pre:Invent2024
shintaro_fukatsu
0
410
データの整合性を保つ非同期処理アーキテクチャパターン / Async Architecture Patterns
mokuo
45
16k
Pythonでもちょっとリッチな見た目のアプリを設計してみる
ueponx
1
530
Lottieアニメーションをカスタマイズしてみた
tahia910
0
120
Unity Android XR入門
sakutama_11
0
150
Multi Step Form, Decentralized Autonomous Organization
pumpkiinbell
1
720
SpringBoot3.4の構造化ログ #kanjava
irof
2
980
Java Webフレームワークの現状 / java web framework at burikaigi
kishida
9
2.2k
さいきょうのレイヤードアーキテクチャについて考えてみた
yahiru
3
740
ASP. NET CoreにおけるWebAPIの最新情報
tomokusaba
0
360
AWS Lambda functions with C# 用の Dev Container Template を作ってみた件
mappie_kochi
0
240
Featured
See All Featured
How GitHub (no longer) Works
holman
313
140k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.3k
The Cost Of JavaScript in 2023
addyosmani
47
7.3k
It's Worth the Effort
3n
184
28k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.4k
What's in a price? How to price your products and services
michaelherold
244
12k
Music & Morning Musume
bryan
46
6.3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
A Tale of Four Properties
chriscoyier
158
23k
The Language of Interfaces
destraynor
156
24k
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ͳΒͰͷݒ೦ϥΠϒϥϦͰΧόʔͰ͖Δ͖ ײ
͖