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.6k
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
3.2k
Redux with iOS
susieyy
0
1.3k
ReduxRxを活用したアプリアーキテクチャ
susieyy
8
2.3k
Redux+Rxを活用したiOSアプリアーキテクチャ
susieyy
10
2k
Swaggerで始めるAPI定義管理とコードジェネレート
susieyy
14
7.5k
開発中のアプリをXcode9 & Swift4に移行しました
susieyy
0
3.7k
Wantedly People ViewModel and Rx
susieyy
7
7.1k
ReduxDevTools' power to the iOS development
susieyy
0
860
Realm Centered Design
susieyy
5
870
Other Decks in Technology
See All in Technology
libsyncrpcってなに?
uhyo
0
230
從開發到架構設計的可觀測性實踐
philipz
0
180
大手企業のAIツール導入の壁を越えて:サイバーエージェントのCursor活用戦略
gunta
34
14k
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
8
66k
Cursor Meetup Tokyo
iamshunta
5
1.4k
CSSの最新トレンド Ver.2025
tonkotsuboy_com
10
3.3k
Agent Development Kit によるエージェント開発入門
enakai00
16
1.9k
為什麼我們需要 Observability?
marcustung
0
460
Java で学ぶ 代数的データ型
ysknsid25
2
1.1k
うちの会社の評判は?SNSの投稿分析にAIを使ってみた
doumae
0
590
Autocon3 - Building Trustworthy Network Automation, From Principles to Practice
dgarros
2
120
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
2.6k
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
41
7.3k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Gamification - CAS2011
davidbonilla
81
5.3k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
Documentation Writing (for coders)
carmenintech
71
4.8k
The Cult of Friendly URLs
andyhume
78
6.4k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
137
34k
Music & Morning Musume
bryan
47
6.6k
Adopting Sorbet at Scale
ufuk
76
9.4k
Stop Working from a Prison Cell
hatefulcrawdad
269
20k
Designing for Performance
lara
608
69k
Rebuilding a faster, lazier Slack
samanthasiow
81
9k
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 )