Cookpad TechConf 2019 〜霞が関〜 クックパッドiOSアプリの 破壊と創造、そして未来

011714704c4a925e542d426d4cdaa4e3?s=47 giginet
February 27, 2019

Cookpad TechConf 2019 〜霞が関〜 クックパッドiOSアプリの 破壊と創造、そして未来

011714704c4a925e542d426d4cdaa4e3?s=128

giginet

February 27, 2019
Tweet

Transcript

  1. @giginet ϞόΠϧج൫෦ ʙբ͕ؔʙ ΫοΫύουiOSΞϓϦͷ ഁյͱ૑଄ɺͦͯ͠ະདྷ

  2. 2 ࠷ॳͷίϛοτ ೥݄ ݱࡏ·Ͱͷίϛοτ   ϦϦʔεස౓ िճ ϦϦʔεลΓͷ։ൃऀ਺ d

    ૯ίʔυߦ਺   ˞ݱࡏͷίʔυϕʔεʹҠߦޙ
  3. 3 ։ൃऀ͝ͱͷ1೔ͷྦྷੵϏϧυ࣌ؒ 1h 1.5h

  4. 4 27% 73% 155,000ߦ 58,700 ߦ Objective-C Swift

  5. ՝୊ 5 •1೔ྦྷੵ1࣌ؒ/ਓΛ্ճΔϏϧυ࣌ؒ •ࠓͳ͓25%͋ΔObjective-C •ϝϯς͞Εͯͳ͍ػೳ •ີ݁߹ա͗ͯͲ͔͜ม͑ΔͱյΕΔ

  6. 6 բ͕ؔ IUUQTKBXJLJQFEJBPSHXJLJ&##%&#$"&"%#&#"#&"

  7. բ͕ؔͷ໨త 7 •ίʔυ੔ཧ •Objective-Cͷഁյ •Ϗϧυ࣌ؒͷվળ

  8. ཧ૝ 8 .PEVMFT %ZOBNJD'SBNFXPSL "QQMJDBUJPO

  9. ݱ࣮

  10. ϚϧνϞδϡʔϧԽ 10 •Ωϟογϡ͕ޮ͖ɺ։ൃ࣌ͷϏϧυߴ଎Խ •ݹ͍࣮૷ͷӅṭ •ը໘ؒΛૄ݁߹ʹͰ͖Δ

  11. Objective-C Bridging 11 11 MyApp-Bridging-Header.h MyApp-Swift.h

  12. բ͕ؔͷΰʔϧ 12 •։ൃऀͷखݩͷϏϧυ࣌ؒΛ1೔30෼Ҏ಺ʹೲΊΔ •Objective-CΛ׬શʹফ͠ڈΔ

  13. ։ൃऀͷੜ࢈ੑΛ ͳΜͱ͔͢Δͷ͕ բ͕ؔ

  14. View Model ViewController

  15. 15 View Model ViewController ϩδοΫΛ࣋ͭ7JFX XXXManager γϯάϧτϯͷσʔλιʔε .BTTJWF7JFX$POUSPMMFS ڞ௨Խ͞ΕͯංେԽͨ͠Ϟσϧ ☠

    σουίʔυ ີ݁߹ 7JFXͷܧঝɺ࢖͍ճ͠ ৮ͬͯ͸ ͍͚ͳ͍΍ͭ ࠞಱ
  16. DataStore UseCase Presenter ViewBuilder View Wireframe Entity DataStore Entity UseCase

    Interactor Presentation Layer Domain Layer Data Layer Repository $PPLQBE7*1&3
  17. 17 Tsukuru Cookpad 7*1&3ԽҎલͷ.7$ 0CKFDUJWF$ 4XJGUͷࠞࡏ 7*1&3Խޙͷը໘ͷू߹ 4XJGU ɾɾɾ ࠞಱ

    Cookpad
  18. 18 Tsukuru Cookpad 7*1&3ԽҎલͷ.7$ 0CKFDUJWF$ 4XJGUͷࠞࡏ 7*1&3Խޙͷը໘ͷू߹ 4XJGU ɾɾɾ 7*1&3ΞϓϦέʔγϣϯ

    Cookpad
  19. طଘͷΞʔΩςΫνϟΛ ੜ͔ͨ͠ ϚϧνϞδϡʔϧԽ

  20. 20

  21. 21 YAML yonaskolb/XcodeGen ࣗಈੜ੒

  22. 22 ৽نλʔήοτ

  23. 23 targets: CookpadCore: type: framework platform: iOS sources: - CookpadCore

    settings: base: PRODUCT_BUNDLE_IDENTIFIER: com.cookpad.CookpadCore scheme: testTargets: - CookpadCoreTests dependencies: - sdk: Foundation.framework - carthage: Result - carthage: RxCocoa - carthage: RxSwift
  24. 24 σΟϨΫτϦߏ଄ʹΑΓ ॴଐ͢ΔϏϧυλʔήοτ͕ อূ͞ΕΔ

  25. xcodeprojΛഁյͨ͠Β Ϟδϡʔϧಋೖ͕༰қʹ

  26. ϚϧνϞδϡʔϧͷ ಋೖ 26

  27. բ͕ؔͷίϯηϓτ 27 •େ͖ͳॻ͖׵͑Λڧ੍͠ͳ͍ •Objective-CΛ࣋ͪࠐ·ͤͳ͍ •࣮૷ৄࡉ͸VIPERΞϓϦέʔγϣϯʹӅṭ

  28. բ͕ؔͷίϯηϓτ 28 •େ͖ͳॻ͖׵͑Λڧ੍͠ͳ͍ •Objective-CΛ࣋ͪࠐ·ͤͳ͍ •࣮૷ৄࡉ͸VIPERΞϓϦέʔγϣϯʹӅṭ

  29. բ͕ؔͷίϯηϓτ 29 •େ͖ͳॻ͖׵͑Λڧ੍͠ͳ͍ •Objective-CΛ࣋ͪࠐ·ͤͳ͍ •࣮૷ৄࡉ͸VIPERΞϓϦέʔγϣϯʹӅṭ

  30. 30 CookpadCore CookpadComponent Cookpad ɾɾɾ Cookpad Tsukuru Feature A Feature

    B Feature C
  31. 31 CookpadCore CookpadComponent Cookpad ɾɾɾ Cookpad Tsukuru Feature A Feature

    B Feature C
  32. 32 CookpadCore CookpadComponent Cookpad ɾɾɾ Cookpad Tsukuru Feature A Feature

    B Feature C
  33. 33 CookpadCore CookpadComponent Cookpad ɾɾɾ Cookpad Tsukuru Feature A Feature

    B Feature C
  34. 34 CookpadCore CookpadComponent Cookpad ɾɾɾ Cookpad Tsukuru Feature A Feature

    B Feature C
  35. 35 CookpadCore CookpadComponent Cookpad ɾɾɾ Cookpad Tsukuru Feature A Feature

    B Feature C ந৅౓
  36. 36 CookpadCore CookpadComponent Cookpad ɾɾɾ Cookpad Tsukuru Feature A Feature

    B Feature C Environment ۩ମతͳ࣮૷ ΠϯλʔϑΣΠεͷΈΛఏڙ
  37. 37 CookpadCore CookpadComponent Cookpad ɾɾɾ Cookpad Tsukuru Feature A Feature

    B Feature C Environment բ͕ؔήʔτ΢ΣΠ
  38. 38 CookpadCore CookpadComponent Cookpad ɾɾɾ Cookpad Tsukuru Feature A Feature

    B Feature C Bridging HeaderΛ ࣋ͨͳ͍
  39. 39 CookpadCore CookpadComponent Cookpad ɾɾɾ Cookpad Tsukuru Feature A Feature

    B Feature C Objective-C Bridge͸ ΞϓϦͰ͚ͩ࣋ͭ
  40. Objective-CΛ ࢓૊Έతʹഉআ SwiftԽͷ༏ઌॱҐΛՄࢹԽ

  41. 41 Cookpad ɾɾɾ Cookpad Tsukuru Feature A Feature B Feature

    C Ӆṭ͍ͨ͠
  42. 42 CookpadCore CookpadComponent Cookpad ɾɾɾ Cookpad Tsukuru Feature A Feature

    B Feature C Environment ΠϯλʔϑΣΠεͷΈΛఏڙ
  43. 43 CookpadCore CookpadComponent Cookpad ɾɾɾ Cookpad Tsukuru Feature A Feature

    B Feature C Environment ݹ͍ϥΠϒϥϦ΁ͷґଘ͸ ΞϓϦͷΈ͕࣋ͭ ۩ମతͳ࣮૷
  44. 44 CookpadCore CookpadComponent Cookpad ɾɾɾ Cookpad Tsukuru Feature A Feature

    B Feature C Environment ݹ͍ϥΠϒϥϦ΁ͷґଘ͸ ΞϓϦͷΈ͕࣋ͭ ۩ମతͳ࣮૷ ػೳͷ։ൃ࣌ʹݹ͍ϥΠϒϥϦΛ ҙࣝ͠ͳͯ͘ࡁΉΑ͏ʹ
  45. 45 APIClient.share Cookpad Tests 45 Method Swizzling API Stub

  46. 46 Environment CookpadEnvironment TestingEnvironment Cookpad Tests Network Logger ը໘ભҠ

  47. 47 CookpadCore CookpadComponent Cookpad ɾɾɾ Cookpad Tsukuru Feature A Feature

    B Feature C Ҡߦத Ҡߦத
  48. ՝୊ 48 Bundle Dynamic Linking Time Tsukuru׬શഁյ Feature moduleҠߦ Ϟδϡʔϧؒͷґଘ

    ద੾ͳϞδϡʔϧ෼ׂ୯Ґ ։ൃ૊৫ͷεέʔϧ Objective-C׬શഁյ
  49. ͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠ !HJHJOFU