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
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
命名をリントする
chiroruxx
1
410
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
3
470
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
770
ドメインイベント増えすぎ問題
h0r15h0
2
310
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
350
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
3
360
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
720
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
190
Jakarta EE meets AI
ivargrimstad
0
240
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.3k
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
RailsConf 2023
tenderlove
29
940
The Invisible Side of Design
smashingmag
298
50k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
98
Typedesign – Prime Four
hannesfritz
40
2.4k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Designing for Performance
lara
604
68k
Documentation Writing (for coders)
carmenintech
66
4.5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
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
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠