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開発を求めて
Search
yutu
August 09, 2017
Programming
1
1.9k
コスパの良いiOS開発を求めて
こんなチームならRedux + Passive MVP + Clean Arch(Essence) が今のところ筋が良いのでは?って試行錯誤して実践している話
yutu
August 09, 2017
Tweet
Share
More Decks by yutu
See All by yutu
FBSnapshotTestCaseに助けられた話
yutu
1
2.5k
Other Decks in Programming
See All in Programming
subpath importsで始めるモック生活
10tera
0
300
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
100
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
2
670
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.7k
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
900
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.3k
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
距離関数を極める! / SESSIONS 2024
gam0022
0
280
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Designing the Hi-DPI Web
ddemaree
280
34k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Unsuck your backbone
ammeep
668
57k
The Language of Interfaces
destraynor
154
24k
What's new in Ruby 2.0
geeforr
343
31k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Why Our Code Smells
bkeepers
PRO
334
57k
Transcript
ίεύͷྑ͍iOS։ൃΛٻΊͯ
ฏҪ ༞थˁ 32 طࠗ • Recruit Marketing Partners • iOS
Engineer • ݘ͕͖
ͯ͞
ίεύʹ ཁͨ͠අ༻ʢίετʣͱ ͦ͜Β͔ΒಘΒΕͨޮՌ
͜͜Ͱ͍͏ίετʹ ֶश࣌ؒ, ࣮࣌ؒ
͜͜Ͱ͍͏ύϑΥʔϚϯεʹ ੜ࢈ੑ, อकੑ, Θ͔Γ͢͞
ΞʔΩςΫνϟͷબఆͬͯ Ή͔͍ͣ͠… ʢϓϩδΣΫτͷنɺϝϯόʔɺ࣌ ظɺ࣌ؒͱ͔͍ΖΜͳഎܠ͕͋Δʣ
ίεύͷ͍͍iOS։ൃͷҰྫͱͯ͠
͜ΜͳνʔϜͳΒ Redux + Passive MVP + Clean Arch(Essence) ͕ࠓͷͱ͜Ζے͕ྑ͍ͷͰʁ ͬͯࢼߦࡨޡ࣮ͯ͠ફ͍ͯ͠Δ
Λ͠·͢
Agenda • ͳͥΒͷνʔϜͰRedux + Passive MVP + Clean Arch(Essence) ͔
• Redux + Passive MVP + Clean Arch(Essence) ͕Βͷνʔ ϜʹԿΛͨΒ͍ͯ͠Δ͔ • Redux + Passive MVP + Clean Arch(Essence) Λࢧ͑Δٕज़ • ·ͱΊ
ͳͥΒͷνʔϜͰRedux + Passive MVP + Clean Arch(Essence) ͔
ΒͷνʔϜͷੜཱ͍ͪ
NewRING byRMP!!!
NewRING byRMP!!! • RMPͷ৽نࣄۀఏҊ੍ • θΫγΟɺΧʔηϯαʔɺελσΟαϓϦɺkidslyͳͲΛੈʹ ૹΓग़͖ͯͨ͠ • ߽՚৹ࠪһͷલͰϓϨθϯͰ͖Δ •
άϥϯϓϦ௨ΕࣄۀԽͰ͖Δ • http://www.recruit-mp.co.jp/feature/company/ newring2017ko.html
NewRING byRMP!!! • 2016213݅ͷԠื • ৭Μͳਓ͕ࢀՃ͢ΔʢӦۀͩͬͨΓاըͩͬ ͨΓҒ͍ਓͩͬͨΓΤϯδχΞͩͬͨΓʣ • ڱ͖ʢग़͚ͨ͠Ͳ௨Βͳ͔ͬͨʣ •
ͰͲΕັྗత
ͭͬͪ͘Ό͑Α͘Ͷʁͬͯࢥͬͯͨ
͋Δ
Producer ݩRailsΤϯδχΞ ύογϣϯ͍͢͝ Engineer A αʔόʔڧ͍ Webϑϩϯτڧ͍ Πϯϑϥڧ͍ DDDಡॻձͱ͔Δਓ Engineer
B ৽ଔ αʔόʔڧ͍ Webϑϩϯτڧ͍ σβΠϯڧ͍ Designer ݩΞϓϦΤϯδχΞ ͔ͩΒΊͬͪΌΓ͍͢ ͓Ζ͍اը
Producer ݩRailsΤϯδχΞ ύογϣϯ͍͢͝ Engineer A αʔόʔڧ͍ Webϑϩϯτڧ͍ Πϯϑϥڧ͍ DDDಡॻձͱ͔Δਓ Engineer
B ৽ଔ αʔόʔڧ͍ Webϑϩϯτڧ͍ σβΠϯڧ͍ Designer ݩΞϓϦΤϯδχΞ ͔ͩΒΊͬͪΌΓ͍͢ ͓Ζ͍اը ΞϓϦΤϯδχΞ ͕͍ͳ͍ʂ
Designer ݩΞϓϦΤϯδχΞ ͔ͩΒΊͬͪΌΓ͍͢ ผ݅Ͱ ͱҰॹʹࣄͨ͠
Designer ݩΞϓϦΤϯδχΞ ͔ͩΒΊͬͪΌΓ͍͢ ผ݅Ͱ ͱҰॹʹࣄͨ͠ ͍ͭ͜Ͱ͑͑Μʂʂ
Producer ݩRailsΤϯδχΞ ύογϣϯ͍͢͝ Engineer A αʔόʔڧ͍ Webϑϩϯτڧ͍ Πϯϑϥڧ͍ DDDಡॻձͱ͔Δਓ Engineer
B ৽ଔ αʔόʔڧ͍ Webϑϩϯτڧ͍ σβΠϯڧ͍ Designer ݩΞϓϦΤϯδχΞ ͔ͩΒΊͬͪΌΓ͍͢ ͓Ζ͍اը
Producer ݩRailsΤϯδχΞ ύογϣϯ͍͢͝ Engineer A αʔόʔڧ͍ Webϑϩϯτڧ͍ Πϯϑϥڧ͍ DDDಡॻձͱ͔Δਓ Engineer
B ৽ଔ αʔόʔڧ͍ Webϑϩϯτڧ͍ σβΠϯڧ͍ Designer ݩΞϓϦΤϯδχΞ ͔ͩΒΊͬͪΌΓ͍͢ ͓Ζ͍اը Զ iOS ڧ͍ αʔόʔͪΐͬͱڧ͍ Ϟς͍ͨ
͜ͷνʔϜͷڧΈ • ࠷ۙͰ͋ΔࣗͷෆΛղܾ͍ͨ͠ਓͨͪͷू·Γ • શһΤϯδχΞ or ΤϯδχΞΛܦݧ͍ͯ͠Δ • Webʹ໌Δ͍ •
DDDΛ࣮ફ͍ͨ͠ͱࢥͬͯΔ • ଞͷϓϥοτϑΥʔϜʹखΛग़͍ͨ͠ҙཉຬʑʢEngineer A Engineer BiOSΓ͍ͨͱࢥͬͯΔʣ
͕͜ͷνʔϜͰΓ͍ͨ͜ͱ • ΞΠσΟΞΛߴ͔ͭߴ࣭ʹ࣮ݱɺͦͯ͠ϦϦʔε͍ͨ͠ • iOSΞϓϦ։ൃͷઙ͍νʔϜϝϯόʔʹͱͬͯग़དྷΔݶΓෑ ډͷ͍ͷʹ͍ͨ͠ • iOS ͷ Redux
࣮ʹڵຯ͕͋ͬͨʢͳΜ͔৽͍͜͠ͱΓ ͍ͨʣ • ihara ʹΞϯαʔιϯάΛॻ͖͔ͨͬͨ (https://tech.recruit- mp.co.jp/mobile/post-12398/)
͜ͷνʔϜͷڧΈ • ࠷ۙͰ͋ΔࣗͷෆΛղܾ͍ͨ͠ਓͨͪͷू·Γ • શһΤϯδχΞ or ΤϯδχΞΛܦݧ͍ͯ͠Δ • Webʹ໌Δ͍ •
DDDΛ࣮ફ͍ͨ͠ͱࢥͬͯΔ • ଞͷϓϥοτϑΥʔϜʹखΛग़͍ͨ͠ҙཉຬʑʢEngineer A Engineer BiOSΓ͍ͨͱࢥͬͯΔʣ
͜ͷνʔϜͷڧΈ • ࠷ۙͰ͋ΔࣗͷෆΛղܾ͍ͨ͠ਓͨͪͷू·Γ • શһΤϯδχΞ or ΤϯδχΞΛܦݧ͍ͯ͠Δ • Webʹ໌Δ͍ •
DDDΛ࣮ફ͍ͨ͠ͱࢥͬͯΔ • ଞͷϓϥοτϑΥʔϜʹखΛग़͍ͨ͠ҙཉຬʑʢEngineer A Engineer BiOSΓ͍ͨͱࢥͬͯΔʣ
Redux + Passive MVP + Clean Arch(Essence)
Why Redux?
Why Redux? • ͱʔʔʔʔ͍ͬͯ͠ΞϓϦͷঢ়ଶཧʹରͯ͠ʮখ ͍֓͞೦ͱ࣮Ͱେ͖ͳΛղܾ͍ͯ͠ΔʯReSwift ʢReduxʣ͕ඇৗʹඒ͍͠ͱײ͍ͯͨ͡ʢhttp:// in.fablic.co.jp/entry/reswiftʣ • ϝϯόʔ͕Webʹ໌Δ͍ͷͰReduxΛಋೖ͔ͬͨ͢͠ •
ΞϓϦͷঢ়ଶʹਅ͔ͬΒཱ͔ͪ͏͜ͱͰ࣮લʹ ʹؾ͚ΔΑ͏ʹ͔ͨͬͨ͠
Why Passive MVP?
Why Passive MVP?
Why Passive MVP? ͓લͩʔʂʂ
Why Passive MVP? • ϞόΠϧΞϓϦʹ͓͚Δ View ͻͱ͜ͱͰ·ͱΊΒΕͳ ͍͙Β͍ෳࡶͰ͍͠ • UIKit
ಠࣗͷ͜ͱʢIBͱ͔ಛʹʣ • Ξχϝʔγϣϯͱ͔ • DIͲ͏͢ΜͶΜͱ͔ • View Controller ͬͯͳΜͶΜͱ͔
Why Passive MVP? • ͨͩͰ͍͑͞͠Ϗϡʔͷ࣮ʹ Redux ͩͱ͔ݻ༗ͷٕ ज़Λॻ͖ͨ͘ͳ͔ͬͨʢData Binding ͩͱͯͦ͠͏ʣ
• Ͱ iOS ॳ৺ऀʹͱͬͯɺΓ͍͢ͷͬͺΓ Ϗϡʔ • Ϗϡʔʹ͍͜͠ͱΛॻ͔ͳ͍͜ͱͰ Engineer Aɺ Engineer BɺDesignerखΛ͚ΒΕΔΑ͏ʹ͔ͨͬ͠ ͨ
Why Clean Arch(Essence)?
Producer ݩRailsΤϯδχΞ ύογϣϯ͍͢͝ Engineer A αʔόʔڧ͍ Webϑϩϯτڧ͍ Πϯϑϥڧ͍ DDDಡॻձͱ͔Δਓ Engineer
B ৽ଔ αʔόʔڧ͍ Webϑϩϯτڧ͍ σβΠϯڧ͍ Designer ݩΞϓϦΤϯδχΞ ͓Ζ͍اը Զ iOS ڧ͍ αʔόʔͪΐͬͱڧ͍
Producer ݩRailsΤϯδχΞ ύογϣϯ͍͢͝ Engineer A αʔόʔڧ͍ Webϑϩϯτڧ͍ Πϯϑϥڧ͍ DDDಡॻձͱ͔Δਓ Engineer
B ৽ଔ αʔόʔڧ͍ Webϑϩϯτڧ͍ σβΠϯڧ͍ Designer ݩΞϓϦΤϯδχΞ ͓Ζ͍اը Զ iOS ڧ͍ αʔόʔͪΐͬͱڧ͍ ͓લͩʔʂʂ
Why Clean Arch(Essence)? • UIʢը໘αΠζʹىҼ͢ΔͷɺUIKit߹ͱ͔ʣWebAPIɺ͋ Δ͍DBʹґଘ͠ͳ͍Α͏ʹϏδωεϩδοΫΛॻ͖͔ͨͬͨ • ΞϓϦͱͯ͜͠ΕΛઌʹٞࣔ͢͜͠ͱͰɺUI/WebAPI/DBΛຊ དྷ͋Δ͖࢟ʹಋ͖͔ͨͬͨ •
ΈΜͳ༏͍͔͠ΒدΓ͕ͪʹͳΔ • DDDʹڵຯͷΤϯδχΞ͕͍Δ͜ͱͰɺಋೖָ͕ͩࣗ͠વͩͱ அͨ͠
Redux + Passive MVP + Clean Arch(Essence) ΒͷνʔϜʹ ԿΛͨΒ͍ͯ͠Δ͔
Redux’ s cons? • ΞϓϦͷঢ়ଶΛపఈͯ͠໌Β͔ʹ͠ͳ͚Εͳ Βͳ͍͔Βਏͦ͏… • ঢ়ଶͱΜͰͳ͍͜ͱʹͳΒͳ͍ʁ • ΞϓϦը໘Ҏ֎ʹWebAPI,ετϨʔδ,σό
Πεͱ͔ͨ͘͞Μ͖߹Θͳ͚ΕͳΒͳ͍ ͷ…
ͪΐͬͱͬͯʂ
ͦΕ࣮͚ͬͯͩͷʁ
ΞϓϦͷঢ়ଶΛෳࡶԽͤ͞ΔཁҼ • ༷͕ෳࡶ • ը໘͕ෳࡶ • ͦͦΞϓϦ։ൃ͕ෳࡶ • etc…
Producer ݩRailsΤϯδχΞ Engineer A αʔόʔڧ͍ Webϑϩϯτڧ͍ Πϯϑϥڧ͍ DDDಡॻձͱ͔Δਓ Engineer B
৽ଔ αʔόʔڧ͍ Webϑϩϯτڧ͍ σβΠϯڧ͍ Designer ݩΞϓϦΤϯδχΞ ͓Ζ͍اը Զ iOS ڧ͍ αʔόʔͪΐͬͱڧ͍
ReduxΛಋೖ͢Δ͜ͱͰ • ϝϯόʔશһ͕ঢ়ଶΛҙࣝ͢ΔΑ͏ʹͳΔ • શһΤϯδχΞ͔ͩΒεςʔτϚγϯਤॻ͚ Δ͠ಡΊΔ • ࣮ɾϦϦʔε͢Δͬͱͬͱલʹؾ͚ Δ
ແବʹෳࡶͰ͍͠ ࣮Λະવʹ͛Δ ʢෳࡶͳঢ়ଶΛϢʔβʔʹ ڧ͍Δલʹ…ʣ
ίεύ͑͑Μʂ
Passive MVPΛಋೖ͢Δ͜ͱͰ • ϝϯόʔશһ҆৺ͯ͠Ϗϡʔ͔ΒiOS։ൃΛֶ ΔΑ͏ʹͳΔ • ϏϡʔΛॻ͍ͯΔͱ͖Ϗϡʔͷ͜ͱ͚ͩϨ Ϗϡʔ͢Εྑ͍ͷͰָʢଞ͔͠Γʣ
ίεύ͑͑Μʂ
Clean Arch(Essence)Λಋೖ͢Δ͜ͱͰ • UIWebAPI͕ΞϓϦʹҾͬுΒΕͣʹઃܭͰ ͖͍ͯΔ • ΞταΠυΠϯͳTDDΛ࣮ફ͍͢͠
ίεύ͑͑Μʂ
Redux + Passive MVP + Clean Arch(Essence) Λࢧ͑Δٕज़
ReSwift Swinject/SwinjectStoryboard
ΒͷνʔϜͷiOS։ൃΛࢧ͑Δٕज़
SwiftLint OHTTPStubs Quick/Nimble Nimble-Snapshots RxSwift APIKit Fastlane CircleCI DeployGate
͕Γ͍ͨ͜ͱ αʔϏεͷ࣮ݱํ๏ʹ৭ΜͳྖҬ͕͋ͬͯɺ ͦΕͧΕͰ৽͍͠ύϥμΠϜ͕࢈·Εͯফ͑ ͯ͘தͰɺΞϓϦΤϯδχΞͱͯ͠ɺ࣋ͪ͏Δ ͋ΒΏΔྗΛۦͯ͠ΠϯϐʔμϯεϛεϚο νΛίεύΑ͘ղফ͠ɺΑΓྑ͘ɾΑΓૣ͘ ՁΛಧ͚Δɻ
܈༤ׂڌͰ ೖΕସΘΓܹ͍͠ࡢࠓ
Redux + Passive MVP + Clean Arch(Essence) Λࢼͯ͠Έͯʂ
Apendixʢ͋Γ͕ͱ͏͍͟͝·͢ʣ • https://speakerdeck.com/ninjinkun/reactive-swift-meetup • https://blog.fenrir-inc.com/jp/2017/08/ios-redux.html • http://blog.j5ik2o.me/entry/2016/09/09/200643 • https://news.realm.io/jp/news/krzysztof-zablocki- mDevCamp-ios-architecture-mvvm-mvc-viper
• https://speakerdeck.com/mpon/unidirectional-data-flow- in-reswift
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠