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
Why use Redux in iOS
Search
yohei sugigami
March 22, 2018
Technology
5
2.5k
Why use Redux in iOS
yohei sugigami
March 22, 2018
Tweet
Share
More Decks by yohei sugigami
See All by yohei sugigami
Snapshot Testing in iOS
susieyy
6
3k
Redux with iOS
susieyy
0
1.1k
ReduxRxを活用したアプリアーキテクチャ
susieyy
8
2.2k
Redux+Rxを活用したiOSアプリアーキテクチャ
susieyy
10
1.9k
Swaggerで始めるAPI定義管理とコードジェネレート
susieyy
14
7.3k
開発中のアプリをXcode9 & Swift4に移行しました
susieyy
0
3.5k
Wantedly People ViewModel and Rx
susieyy
7
6.8k
ReduxDevTools' power to the iOS development
susieyy
0
790
Realm Centered Design
susieyy
5
760
Other Decks in Technology
See All in Technology
とあるOSSを継続可能にするための取り組みについて / OSS Refactoring Process
bun913
1
210
どこよりも遅めなWinActor Ver.7.5.0 新機能紹介
tamai_63
0
210
技術的負債解消の取り組みと専門チームのお話
bengo4com
0
330
Segment Anything Model 2
tenten0727
3
700
社内の学びの場・コミュニティ形成とエンジニア同士のリレーションシップ構築/devreljapan2024
nishiuma
3
290
2024年のナビゲーション・フォーカス対応:Composeでキーボード・ナビゲーションをサポートしよう
tahia910
0
110
タイミーのレコメンドにおける ABテストの運用
ozeshun
1
140
突撃! 隣のAmazon Bedrockユーザー 〜YouはどうしてAWSで?〜
minorun365
PRO
3
390
Creative UIs with Compose: DroidKaigi 2024
chrishorner
1
580
不動産売買取引におけるAIの可能性とプロダクトでのAI活用
zabio3
0
270
再考 アクターモデル/ reconsider actor model
ytake
0
360
スタッフエンジニアの道: The Staff Engineer’s Path
snoozer05
PRO
44
14k
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
653
58k
Designing the Hi-DPI Web
ddemaree
278
34k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
278
13k
Building Applications with DynamoDB
mza
90
6k
Pencils Down: Stop Designing & Start Developing
hursman
119
11k
Learning to Love Humans: Emotional Interface Design
aarron
270
40k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
29
2.6k
What's in a price? How to price your products and services
michaelherold
242
11k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
36
2.1k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
28
1.6k
Atom: Resistance is Futile
akmur
261
25k
Transcript
ɹ ɹ Why use Redux in iOS ɹ ɹ ɹ
iOS Flux/Reduxษڧձ 2018/03/22@Wantedly Yohei Suginami ( @susieyy )
Profile — Yohei Sugigami — susieyy — Twitter / Qiita
/ Github — New app development specialist — Clients — Folio.inc — New app developer — Wantedly.inc — Technical advisor
ɹ ɹ ɹ ɹ Flux/ReduxΓ্͕ͬͯ·͢Ͷʂ
ɹ ɹ ɹ ɹ ϨΩγΛৼΓฦΔ
None
None
None
None
None
None
None
None
None
None
ɹ ɹ ɹ ɹ ຊͰ࠾༻ࣄྫ͕૿͑ͯ·͢Ͷʂ
ɹ ɹ ͳͥReduxͳͷ͔
ɹ ɹ ΞϓϦ։ൃʹ͓͚Δ ࠷େͷ՝ɹɹɹ
ɹ ɹ ෳࡶͰ͋Δ͜ͱ
Ͳ͏γϯϓϧʹམͱ͠ࠐΉ͔ɹɹɹ ɹ ɹ ɹ ɹ ѲɾཧͰ͖ΔΑ͏ʹ͢Δ͔
ΞϓϦ։ൃʹ͓͚Δෳࡶੑͱ खଓ͖తهड़ʹΑΔॲཧͷྲྀΕͷѲͷ͠ʹ͘͞ — σϦήʔτύλʔϯͷίʔϧόοΫࠈ — ϑΝοτίϯτϩʔϥʔ
ΞϓϦ։ൃʹ͓͚Δෳࡶੑͱ Өڹൣғͷෆ͔֬͞ɺہॴԽ͞ΕͣҬͳӨڹൣғ — γϯάϧτϯʢάϩʔόϧมͷଟ༻ʣ
ΞϓϦ։ൃʹ͓͚Δෳࡶੑͱ ଟ༷ͳঢ়ଶͷදݱͷͨΊʹଟͷذͱଟͷมͷग़ݱ — ม͕มԽ͢ΔཁҼ͕ࡏԽ — ݅ذʹ্༷ભҠ͠ͳ͍ܦ࿏ؚ·ΕΔ
ॾѱͷࠜݯMVC ෳࡶੑͷղܾࡦΛMVCʹมΘΔΞʔΩςΫνϟٻΊͨ — MVVMʢCʣʴFRP — CleanAcrhitecture / Viper — Flux
/ Redux
MVVMʢCʣʴFRP ෳࡶੑͷରቂ — ϦΞΫςΟϒͳؔʹநԽ͠ɺతͰએݴతͳهड़ — ࿈ଓ͢Δ૬ޓ࡞༻Λѻ͍͍͢ — ঢ়ଶอ࣋ͷͨΊͷมΛݮ — ↑
RxͷετϦʔϜʹแ — ඇಉظΛབྷΊͨॲཧͷՄಡੑߴ͍දݱྗ — εϐʔυײ͋Δ։ൃ
MVVMʢCʣʴFRP σϝϦοτ — ߴ͍ͷநԽʹΑΔهड़қͷ্ঢ — ෳࡶͳRxͷΦϖϨʔλʔΛۦ͢Δ͜ͱͰ͔͑ͬͯڍಈ͕ Θ͔Γʹ͍͘ — ϚϧνεϨουͳॲཧ֤ετϦʔϜͰಠཱతʹಈ࡞͢Δ —
هड़ྗߴ͍͕ಈ࡞ͷѲɾσόοά͠ʹ͍͘
CleanAcrhitecture / Viper ෳࡶੑͷରቂ — ΦϒδΣΫτࢦͷׂͰγϯϓϧʹམͱ͠ࠐΉ — ϨΠϠʔׂɾґଘͷࢦੑ — ϨΠϠʔͷΠϯλʔϑΣΠεͱ࣮ͷʹΑΔநԽ
— νʔϜεέʔϥϏϦςΟͷ্
CleanAcrhitecture / Viper σϝϦοτ — ʹΑΔهड़ྔ͕૿͑Δίʔυ — ։ൃεϐʔυͷݮ — ঢ়ଶͱखଓ͖ΛΧϓηϧԽʹΑΔγϯϓϧԽͷݶք
ɹ ɹ ReduxͱԿ͔
None
None
Մಡੑͷ্ ॻ͘ίετΑΓɺಡΉίετΛԼ͛Δ — ಡΈ͘͢ɺΓ͍ͨ͜ͱɾॲཧ͕Ѳ͍͢͠ — Өڹൣғ͕ਪఆ͍͢͠ — ϨϏϡʔ͍͢͠ — εϐʔυײ͋Δ։ൃ
— ΞϓϦنͱνʔϜߏͷεέʔϥϏϦςΟͷ্
Viewͱঢ়ଶͷશͳΔ — ViewͷॲཧͰͦͷॠؒͷΞϓϦͷͯ͢ͷঢ়ଶ ʢState)͕ҰҙͰ͋Δ͜ͱΛอূ͞ΕΔ — StateΠϛϡʔλϒϧ — ͦͷॠؒͷঢ়ଶʹରͯ͠ඇಉظͷհೖ͕ͳ͍ — ViewʹStateΔͱදࣔҰҙʹܾ·Δ
— View͕ؔܕࢦʹͳΔ
७ਮؔ — ೖྗʹରͯ݁͠Ռ͕ҰҙͰ͋Δ — ϓϩάϥϛϯάʹ͓͍ͯϩδοΫΛγϯϓϧѻ͏ͨΊͷۃ Έ — ෭࡞༻ഉআͱ — ςελϏϦςΟ্
Ϛγϯύϫʔ্͕͕ͬͨ͜ͱʹΑΔ߽తͳΞʔΩςΫνϟ ϚγϯύϫʔΛ͏·͘ར༻͢Δ͜ͱͰγϯϓϧΛ࣮ݱ͍ͯ͠Δ ॲཧͷྻԽ - ϝΠϯεϨου্ͰϏδωεϩδοΫ(ߋ৽ॲཧ)ͷಈ࡞ - γϯάϧϝΠϯεϨου͚ͩͰಈ࡞͍ͯ͠ΔΑ͏ͳײ֮ͰΞ ϓϦ͕ॻ͚Δ Viewͷޮతͳߋ৽ͷͨΊͷࠩݕίετ -
ϏδωεϩδοΫॲཧޙͷViewͷӨڹൣғΛؔ͠ͳ͍
Swi!ݴޠͱͷ૬ੑͷྑ͞ — TypeSafe — Struct / Immutable — ComputedProperty —
Enum / PatternMatch — Generics — Functional Oriented — Protocol Oriented
σόοά༰қੑ ɹ DEMO
Redux՝ — ΞΫγϣϯͷॱংੑΛ੍͚͍ͮͨʢεςʔτϚγϯʣ — Actionϧʔϓ — StateͷΠχγϟϥΠζͱΦϓγϣϯφϧ — ϝϞϦϚωδϝϯτʢը໘ഁغ࣌ʹ෦Stateͷഁغʣ —
Viewͷޮతͳߋ৽ͷͨΊͷࠩߋ৽ʢվળͷ༨͋Γʣ
ReduxۜͷؙͰͳ͍ ɹ ɹ ɹ దࡐ͔Ͳ͏͔ɹɹɹɹɹ ΞϓϦཁ݅ɺ࣭ཁ݅ɹɹɹɹ νʔϜߏɺ։ൃظؒ࣍ୈɹɹ
·ͱΊ Reduxඇৗʹݫ֨ɾݎ࿚Ͱ͋ΓγϯϓϧͳϩδοΫܗ — ७ਮؔ — Πϛϡʔλϒϧ — ୯Ұࢦੑϑϩʔ ʢ ϚϧνεϨουͷہॴԽ
ʣ — ෭࡞༻ʢඇಉظॲཧʣͷہॴԽ
߹ΘͤͯಡΈ͍࣮ͨફฤ ɹ Redux+RxΛ׆༻ͨ͠ΞϓϦΞʔ ΩςΫνϟ CA.swi! #5 2018/01/25@גࣜձࣾαΠόʔΤʔδΣϯτ Yohei Suginami (
@susieyy )