Slide 1

Slide 1 text

ίεύͷྑ͍iOS։ൃΛٻΊͯ

Slide 2

Slide 2 text

ฏҪ ༞थˁ 32 طࠗ • Recruit Marketing Partners • iOS Engineer • ݘ͕޷͖

Slide 3

Slide 3 text

ͯ͞

Slide 4

Slide 4 text

ίεύʹ ཁͨ͠අ༻ʢίετʣͱ ͦ͜Β͔ΒಘΒΕͨޮՌ

Slide 5

Slide 5 text

͜͜Ͱ͍͏ίετʹ ֶश࣌ؒ, ࣮૷࣌ؒ

Slide 6

Slide 6 text

͜͜Ͱ͍͏ύϑΥʔϚϯεʹ ੜ࢈ੑ, อकੑ, Θ͔Γ΍͢͞

Slide 7

Slide 7 text

ΞʔΩςΫνϟͷબఆͬͯ Ή͔͍ͣ͠… ʢϓϩδΣΫτͷن໛ɺϝϯόʔɺ࣌ ظɺ࣌ؒͱ͔͍ΖΜͳഎܠ͕͋Δʣ

Slide 8

Slide 8 text

ίεύͷ͍͍iOS։ൃͷҰྫͱͯ͠

Slide 9

Slide 9 text

͜ΜͳνʔϜͳΒ Redux + Passive MVP + Clean Arch(Essence) ͕ࠓͷͱ͜Ζے͕ྑ͍ͷͰ͸ʁ ͬͯࢼߦࡨޡ࣮ͯ͠ફ͍ͯ͠Δ ࿩Λ͠·͢

Slide 10

Slide 10 text

Agenda • ͳͥ๻ΒͷνʔϜͰ͸Redux + Passive MVP + Clean Arch(Essence) ͔ • Redux + Passive MVP + Clean Arch(Essence) ͕๻Βͷνʔ ϜʹԿΛ΋ͨΒ͍ͯ͠Δ͔ • Redux + Passive MVP + Clean Arch(Essence) Λࢧ͑Δٕज़ • ·ͱΊ

Slide 11

Slide 11 text

ͳͥ๻ΒͷνʔϜͰ͸Redux + Passive MVP + Clean Arch(Essence) ͔

Slide 12

Slide 12 text

๻ΒͷνʔϜͷੜཱ͍ͪ

Slide 13

Slide 13 text

NewRING byRMP!!!

Slide 14

Slide 14 text

NewRING byRMP!!! • RMPͷ৽نࣄۀఏҊ੍౓ • θΫγΟɺΧʔηϯαʔɺελσΟαϓϦɺkidslyͳͲΛੈʹ ૹΓग़͖ͯͨ͠ • ߽՚৹ࠪһͷલͰϓϨθϯͰ͖Δ • άϥϯϓϦ௨Ε͹ࣄۀԽͰ͖Δ • http://www.recruit-mp.co.jp/feature/company/ newring2017ko.html

Slide 15

Slide 15 text

NewRING byRMP!!! • 2016͸213݅ͷԠื • ৭Μͳਓ͕ࢀՃ͢ΔʢӦۀͩͬͨΓاըͩͬ ͨΓҒ͍ਓͩͬͨΓΤϯδχΞͩͬͨΓʣ • ڱ͖໳ʢ๻΋ग़͚ͨ͠Ͳ௨Βͳ͔ͬͨʣ • Ͱ΋ͲΕ΋ັྗత

Slide 16

Slide 16 text

ͭͬͪ͘Ό͑͹Α͘Ͷʁͬͯࢥͬͯͨ

Slide 17

Slide 17 text

͋Δ೔

Slide 18

Slide 18 text

Producer ݩRailsΤϯδχΞ ύογϣϯ͍͢͝ Engineer A αʔόʔڧ͍ Webϑϩϯτڧ͍ Πϯϑϥڧ͍ DDDಡॻձͱ͔΍Δਓ Engineer B ৽ଔ αʔόʔڧ͍ Webϑϩϯτڧ͍ σβΠϯڧ͍ Designer ݩΞϓϦΤϯδχΞ ͔ͩΒΊͬͪΌ΍Γ΍͍͢ ͓΋Ζ͍اը

Slide 19

Slide 19 text

Producer ݩRailsΤϯδχΞ ύογϣϯ͍͢͝ Engineer A αʔόʔڧ͍ Webϑϩϯτڧ͍ Πϯϑϥڧ͍ DDDಡॻձͱ͔΍Δਓ Engineer B ৽ଔ αʔόʔڧ͍ Webϑϩϯτڧ͍ σβΠϯڧ͍ Designer ݩΞϓϦΤϯδχΞ ͔ͩΒΊͬͪΌ΍Γ΍͍͢ ͓΋Ζ͍اը ΞϓϦΤϯδχΞ ͕͍ͳ͍ʂ

Slide 20

Slide 20 text

Designer ݩΞϓϦΤϯδχΞ ͔ͩΒΊͬͪΌ΍Γ΍͍͢ ͸ผ݅Ͱ ͱҰॹʹ࢓ࣄͨ͠

Slide 21

Slide 21 text

Designer ݩΞϓϦΤϯδχΞ ͔ͩΒΊͬͪΌ΍Γ΍͍͢ ͸ผ݅Ͱ ͱҰॹʹ࢓ࣄͨ͠ ͍ͭ͜Ͱ͑͑΍Μʂʂ

Slide 22

Slide 22 text

Producer ݩRailsΤϯδχΞ ύογϣϯ͍͢͝ Engineer A αʔόʔڧ͍ Webϑϩϯτڧ͍ Πϯϑϥڧ͍ DDDಡॻձͱ͔΍Δਓ Engineer B ৽ଔ αʔόʔڧ͍ Webϑϩϯτڧ͍ σβΠϯڧ͍ Designer ݩΞϓϦΤϯδχΞ ͔ͩΒΊͬͪΌ΍Γ΍͍͢ ͓΋Ζ͍اը

Slide 23

Slide 23 text

Producer ݩRailsΤϯδχΞ ύογϣϯ͍͢͝ Engineer A αʔόʔڧ͍ Webϑϩϯτڧ͍ Πϯϑϥڧ͍ DDDಡॻձͱ͔΍Δਓ Engineer B ৽ଔ αʔόʔڧ͍ Webϑϩϯτڧ͍ σβΠϯڧ͍ Designer ݩΞϓϦΤϯδχΞ ͔ͩΒΊͬͪΌ΍Γ΍͍͢ ͓΋Ζ͍اը Զ iOS ڧ͍ αʔόʔͪΐͬͱڧ͍ Ϟς͍ͨ

Slide 24

Slide 24 text

͜ͷνʔϜͷڧΈ • ࠷΋਎ۙͰ͋Δࣗ෼ͷෆΛղܾ͍ͨ͠ਓͨͪͷू·Γ • શһΤϯδχΞ or ΤϯδχΞΛܦݧ͍ͯ͠Δ • Webʹ໌Δ͍ • DDDΛ࣮ફ͍ͨ͠ͱࢥͬͯΔ • ଞͷϓϥοτϑΥʔϜʹखΛग़͍ͨ͠ҙཉຬʑʢEngineer A ΋ Engineer B΋iOS΍Γ͍ͨͱࢥͬͯΔʣ

Slide 25

Slide 25 text

๻͕͜ͷνʔϜͰ΍Γ͍ͨ͜ͱ • ΞΠσΟΞΛߴ଎͔ͭߴ඼࣭ʹ࣮ݱɺͦͯ͠ϦϦʔε͍ͨ͠ • iOSΞϓϦ։ൃͷઙ͍νʔϜϝϯόʔʹͱͬͯग़དྷΔݶΓෑ ډͷ௿͍΋ͷʹ͍ͨ͠ • iOS ͷ Redux ࣮૷ʹڵຯ͕͋ͬͨʢͳΜ͔৽͍͜͠ͱ΍Γ ͍ͨʣ • ihara ʹΞϯαʔιϯάΛॻ͖͔ͨͬͨ (https://tech.recruit- mp.co.jp/mobile/post-12398/)

Slide 26

Slide 26 text

͜ͷνʔϜͷڧΈ • ࠷΋਎ۙͰ͋Δࣗ෼ͷෆΛղܾ͍ͨ͠ਓͨͪͷू·Γ • શһΤϯδχΞ or ΤϯδχΞΛܦݧ͍ͯ͠Δ • Webʹ໌Δ͍ • DDDΛ࣮ફ͍ͨ͠ͱࢥͬͯΔ • ଞͷϓϥοτϑΥʔϜʹखΛग़͍ͨ͠ҙཉຬʑʢEngineer A ΋ Engineer B΋iOS΍Γ͍ͨͱࢥͬͯΔʣ

Slide 27

Slide 27 text

͜ͷνʔϜͷڧΈ • ࠷΋਎ۙͰ͋Δࣗ෼ͷෆΛղܾ͍ͨ͠ਓͨͪͷू·Γ • શһΤϯδχΞ or ΤϯδχΞΛܦݧ͍ͯ͠Δ • Webʹ໌Δ͍ • DDDΛ࣮ફ͍ͨ͠ͱࢥͬͯΔ • ଞͷϓϥοτϑΥʔϜʹखΛग़͍ͨ͠ҙཉຬʑʢEngineer A ΋ Engineer B΋iOS΍Γ͍ͨͱࢥͬͯΔʣ

Slide 28

Slide 28 text

Redux + Passive MVP + Clean Arch(Essence)

Slide 29

Slide 29 text

Why Redux?

Slide 30

Slide 30 text

Why Redux? • ͱʔʔʔʔͬͯ΋೉͍͠ΞϓϦͷঢ়ଶ؅ཧʹରͯ͠ʮখ ͍֓͞೦ͱ࣮૷Ͱେ͖ͳ໰୊Λղܾ͍ͯ͠ΔʯReSwift ʢReduxʣ͕ඇৗʹඒ͍͠ͱײ͍ͯͨ͡ʢhttp:// in.fablic.co.jp/entry/reswiftʣ • ϝϯόʔ͕Webʹ໌Δ͍ͷͰReduxΛಋೖ͠΍͔ͬͨ͢ • ΞϓϦͷঢ়ଶʹਅͬ޲͔Βཱͪ޲͔͏͜ͱͰ࣮૷લʹ໰ ୊ʹؾ෇͚ΔΑ͏ʹ͔ͨͬͨ͠

Slide 31

Slide 31 text

Why Passive MVP?

Slide 32

Slide 32 text

Why Passive MVP?

Slide 33

Slide 33 text

Why Passive MVP? ͓લͩʔʂʂ

Slide 34

Slide 34 text

Why Passive MVP? • ϞόΠϧΞϓϦʹ͓͚Δ View ͸ͻͱ͜ͱͰ·ͱΊΒΕͳ ͍͙Β͍ෳࡶͰ೉͍͠ • UIKit ಠࣗͷ͜ͱʢIBͱ͔ಛʹʣ • Ξχϝʔγϣϯͱ͔ • DIͲ͏͢ΜͶΜͱ͔ • View Controller ͬͯͳΜ΍ͶΜͱ͔

Slide 35

Slide 35 text

Why Passive MVP? • ͨͩͰ͑͞೉͍͠Ϗϡʔͷ࣮૷ʹ Redux ͩͱ͔ݻ༗ͷٕ ज़Λॻ͖ͨ͘ͳ͔ͬͨʢData Binding ͩͱͯ͠΋ͦ͏ʣ • Ͱ΋ iOS ॳ৺ऀʹͱͬͯɺ΍Γ΍͍͢ͷ͸΍ͬͺΓ Ϗϡʔ • Ϗϡʔʹ೉͍͜͠ͱΛॻ͔ͳ͍͜ͱͰ Engineer Aɺ Engineer BɺDesigner΋खΛ෇͚ΒΕΔΑ͏ʹ͔ͨͬ͠ ͨ

Slide 36

Slide 36 text

Why Clean Arch(Essence)?

Slide 37

Slide 37 text

Producer ݩRailsΤϯδχΞ ύογϣϯ͍͢͝ Engineer A αʔόʔڧ͍ Webϑϩϯτڧ͍ Πϯϑϥڧ͍ DDDಡॻձͱ͔΍Δਓ Engineer B ৽ଔ αʔόʔڧ͍ Webϑϩϯτڧ͍ σβΠϯڧ͍ Designer ݩΞϓϦΤϯδχΞ ͓΋Ζ͍اը Զ iOS ڧ͍ αʔόʔͪΐͬͱڧ͍

Slide 38

Slide 38 text

Producer ݩRailsΤϯδχΞ ύογϣϯ͍͢͝ Engineer A αʔόʔڧ͍ Webϑϩϯτڧ͍ Πϯϑϥڧ͍ DDDಡॻձͱ͔΍Δਓ Engineer B ৽ଔ αʔόʔڧ͍ Webϑϩϯτڧ͍ σβΠϯڧ͍ Designer ݩΞϓϦΤϯδχΞ ͓΋Ζ͍اը Զ iOS ڧ͍ αʔόʔͪΐͬͱڧ͍ ͓લͩʔʂʂ

Slide 39

Slide 39 text

Why Clean Arch(Essence)? • UIʢը໘αΠζʹىҼ͢Δ΋ͷɺUIKit౎߹ͱ͔ʣ΍WebAPIɺ͋ Δ͍͸DBʹґଘ͠ͳ͍Α͏ʹϏδωεϩδοΫΛॻ͖͔ͨͬͨ • ΞϓϦͱͯ͜͠ΕΛઌʹٞ࿦ࣔ͢͜͠ͱͰɺUI/WebAPI/DBΛຊ དྷ͋Δ΂͖࢟ʹಋ͖͔ͨͬͨ • ΈΜͳ༏͍͔͠ΒدΓ͕ͪʹͳΔ • DDDʹڵຯͷΤϯδχΞ͕͍Δ͜ͱͰɺಋೖָ͕ͩࣗ͠વͩͱ൑ அͨ͠

Slide 40

Slide 40 text

Redux + Passive MVP + Clean Arch(Essence) ͸๻ΒͷνʔϜʹ ԿΛ΋ͨΒ͍ͯ͠Δ͔

Slide 41

Slide 41 text

Redux’ s cons? • ΞϓϦͷঢ়ଶΛపఈͯ͠໌Β͔ʹ͠ͳ͚Ε͹ͳ Βͳ͍͔Βਏͦ͏… • ঢ়ଶͱΜͰ΋ͳ͍͜ͱʹͳΒͳ͍ʁ • ΞϓϦ͸ը໘Ҏ֎ʹ΋WebAPI,ετϨʔδ,σό Πεͱ͔ͨ͘͞Μ޲͖߹Θͳ͚Ε͹ͳΒͳ͍ ͷ…

Slide 42

Slide 42 text

ͪΐͬͱ଴ͬͯʂ

Slide 43

Slide 43 text

ͦΕ࣮ͬͯ૷͚ͩͷ໰୊ʁ

Slide 44

Slide 44 text

ΞϓϦͷঢ়ଶΛෳࡶԽͤ͞ΔཁҼ • ࢓༷͕ෳࡶ • ը໘͕ෳࡶ • ͦ΋ͦ΋ΞϓϦ։ൃ͕ෳࡶ • etc…

Slide 45

Slide 45 text

Producer ݩRailsΤϯδχΞ Engineer A αʔόʔڧ͍ Webϑϩϯτڧ͍ Πϯϑϥڧ͍ DDDಡॻձͱ͔΍Δਓ Engineer B ৽ଔ αʔόʔڧ͍ Webϑϩϯτڧ͍ σβΠϯڧ͍ Designer ݩΞϓϦΤϯδχΞ ͓΋Ζ͍اը Զ iOS ڧ͍ αʔόʔͪΐͬͱڧ͍

Slide 46

Slide 46 text

ReduxΛಋೖ͢Δ͜ͱͰ • ϝϯόʔશһ͕ঢ়ଶΛҙࣝ͢ΔΑ͏ʹͳΔ • શһΤϯδχΞ͔ͩΒεςʔτϚγϯਤॻ͚ Δ͠ಡΊΔ • ࣮૷ɾϦϦʔε͢Δ΋ͬͱ΋ͬͱલʹؾ෇͚ Δ

Slide 47

Slide 47 text

ແବʹෳࡶͰ೉͍͠ ࣮૷Λະવʹ๷͛Δ ʢෳࡶͳঢ়ଶΛϢʔβʔʹ ڧ͍Δલʹ…ʣ

Slide 48

Slide 48 text

ίεύ͑͑΍Μʂ

Slide 49

Slide 49 text

Passive MVPΛಋೖ͢Δ͜ͱͰ • ϝϯόʔશһ҆৺ͯ͠Ϗϡʔ͔ΒiOS։ൃΛֶ ΂ΔΑ͏ʹͳΔ • ϏϡʔΛॻ͍ͯΔͱ͖͸Ϗϡʔͷ͜ͱ͚ͩϨ Ϗϡʔ͢Ε͹ྑ͍ͷͰָʢଞ΋͔͠Γʣ

Slide 50

Slide 50 text

ίεύ͑͑΍Μʂ

Slide 51

Slide 51 text

Clean Arch(Essence)Λಋೖ͢Δ͜ͱͰ • UI΍WebAPI͕ΞϓϦʹҾͬுΒΕͣʹઃܭͰ ͖͍ͯΔ • Ξ΢ταΠυΠϯͳTDDΛ࣮ફ͠΍͍͢

Slide 52

Slide 52 text

ίεύ͑͑΍Μʂ

Slide 53

Slide 53 text

Redux + Passive MVP + Clean Arch(Essence) Λࢧ͑Δٕज़

Slide 54

Slide 54 text

ReSwift Swinject/SwinjectStoryboard

Slide 55

Slide 55 text

๻ΒͷνʔϜͷiOS։ൃΛࢧ͑Δٕज़

Slide 56

Slide 56 text

SwiftLint OHTTPStubs Quick/Nimble Nimble-Snapshots RxSwift APIKit Fastlane CircleCI DeployGate

Slide 57

Slide 57 text

๻͕΍Γ͍ͨ͜ͱ αʔϏεͷ࣮ݱํ๏ʹ৭ΜͳྖҬ͕͋ͬͯɺ ͦΕͧΕͰ৽͍͠ύϥμΠϜ͕࢈·Εͯ͸ফ͑ ͯ͘தͰɺΞϓϦΤϯδχΞͱͯ͠ɺ࣋ͪ͏Δ ͋ΒΏΔྗΛۦ࢖ͯ͠ΠϯϐʔμϯεϛεϚο νΛίεύΑ͘ղফ͠ɺΑΓྑ͘ɾΑΓૣ͘ Ձ஋Λಧ͚Δɻ

Slide 58

Slide 58 text

܈༤ׂڌͰ ೖΕସΘΓܹ͍͠ࡢࠓ

Slide 59

Slide 59 text

Redux + Passive MVP + Clean Arch(Essence) Λࢼͯ͠Έͯ͸ʂ

Slide 60

Slide 60 text

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

Slide 61

Slide 61 text

͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠