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
DevinとCursorから学ぶAIエージェントメモリーの設計とMoatの考え方
itarutomy
1
640
【PHP】破壊的バージョンアップと戦った話〜決断と説得
satoshi256kbyte
0
120
[Fin-JAWS 第38回 ~re:Invent 2024 金融re:Cap~]FaultInjectionServiceアップデート@pre:Invent2024
shintaro_fukatsu
0
400
CI改善もDatadogとともに
taumu
0
110
Honoをフロントエンドで使う 3つのやり方
yusukebe
5
2.2k
[JAWS-UG横浜 #79] re:Invent 2024 の DB アップデートは Multi-Region!
maroon1st
1
140
GAEログのコスト削減
mot_techtalk
0
110
SRE、開発、QAが協業して挑んだリリースプロセス改革@SRE Kaigi 2025
nealle
3
4.1k
法律の脱レガシーに学ぶフロントエンド刷新
oguemon
5
730
TokyoR116_BeginnersSession1_環境構築
kotatyamtema
0
110
自分ひとりから始められる生産性向上の取り組み #でぃーぷらすオオサカ
irof
8
2.6k
Software Architecture
hschwentner
6
2.1k
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
We Have a Design System, Now What?
morganepeng
51
7.4k
The Cost Of JavaScript in 2023
addyosmani
47
7.3k
Optimizing for Happiness
mojombo
376
70k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.3k
Writing Fast Ruby
sferik
628
61k
Building an army of robots
kneath
302
45k
Facilitating Awesome Meetings
lara
51
6.2k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
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ͳΒͰͷݒ೦ϥΠϒϥϦͰΧόʔͰ͖Δ͖ ײ
͖