みてね iOS版の開発手順書 - みてねのMeetup#1 / mitene ios development steps

みてね iOS版の開発手順書 - みてねのMeetup#1 / mitene ios development steps

2018/6/29 Fri. "みてねのMeetup#1" で発表したスライドです。
iOS版の開発について順をおって説明しました。

D62ad26d5db87a3a62ae97c77a252c22?s=128

atsushisakai

June 29, 2018
Tweet

Transcript

  1. iOS൛ͷ։ൃखॱॻ @_atsushisakai ΈͯͶͷMeetup #1

  2. ࣗݾ঺հ ञҪ ಞ @_atsushisakai • 2011೥11݄ ϛΫγΟೖࣾ • 2012೥ʙ2014೥ SNS

    mixiʹؔ࿈ͨ͠ECܥͷ৽نࣄۀΛෳ਺։ൃ • 2014೥ʙ ΈͯͶ૑ۀ࣌ʹiOSΤϯδχΞͱͯ͠ࢀՃ • 2017೥4݄ʙ ΈͯͶࣄۀ෦ ։ൃάϧʔϓϚωʔδϟ • 2018೥1݄ʙ SREνʔϜॴଐɺΠϯϑϥઐ೦ɺߴ଎Խɾෛՙ෼ࢄ
  3. ࿩͢͜ͱ • iOS൛ΈͯͶ͸ɺԿΛߟ͑ͯઃܭ͞ΕɺͲͷΑ͏ʹ։ൃΛߦ͍ͬͯΔ͔ • ΞʔΩςΫνϟࣗମͷ࿩Ͱ͸ͳ͘ɺ͋ΔΞʔΩςΫνϟͷ্Ͱ࣮ࡍʹͲ͏ ։ൃ͍ͯ͠Δ͔ • Kyashͷ@konifar͞ΜʹӨڹΛड͚ͨൃද • https://drive.google.com/file/d/

    1rlL1AdE5R_M1UAxVW_lY4orFTIEBfFJY/view
  4. iOS൛ΈͯͶͷࣦഊ • ίʔυ্ͷࣦഊ • MVC ( or MVP) • FatViewController

    • ඈͼަ͏NSNotification • ґଘؔ܎͕ແ஡ͳSingletonͷେྔൃੜ • ωετ͠·͘ΔObjective-C block, Swift Closure • ͱΓ͋͑ͣManager • ແҙຯʹੜ͑ΔExtension • ౰વͷΑ͏ʹଘࡏ͠ͳ͍ςετίʔυ ɹ…
  5. iOS൛ΈͯͶͷࣦഊ • ίʔυ͕ϏδωεʹѱӨڹΛ΋ͨΒ͢ • ଐਓԽ • Ϟνϕʔγϣϯ௿Լ • ݟੵ΋Γਫ਼౓ͷ௿Լ •

    CSελοϑʹ͠Θدͤ
  6. ΞʔΩςΫνϟ࡮৽ • 2018೥1݄͝Ζʹ࣮ࢪ • ଟਓ਺։ൃʹ΋଱͑͏Δ΋ͷʹ͍ͨ͠ • ςετΛॻ͘ʢॻ͚ΔΑ͏ʹ͢Δʣ • ॻ͘ՕॴΛ໌֬ʹنఆ͢Δʢॻ͔ͳ͍͍ͯ͘ͱ͜Ζ͸ॻ͔ͳ͍ʣ •

    ԿΛ࡞Δ͔ɺࣄલʹ೺ѲՄೳ • ॳΊͯͷਓͰ΋ා͘ͳ͍
  7. λʔχϯάϙΠϯτ • bufferapp/android-clean-architecture-boilerplate • KotlinͰClean ArchitectureΛ࣮૷ͨ͠AndroidΞϓϦͷαϯϓϧίʔυ • ͦͷ··ͦͬ͘ΓiOS/Swiftʹస༻Ͱ͖Δ • ࣗ෼ͷΞϓϦͰ΍͍ͬͯ͘ؾ͕࣋ͪߴ·ͬͨ

  8. େํ਑ • MVP • PresenterͷςετΛॻ͖ViewControllerΛബ͘͢Δ • CleanArchitecture • ModelϨΠϠʔΛ੔ཧ͠ɺڊେͳPresenter΍Managerʹ͠ͳ͍ •

    RxSwiftΛઃܭʹऔΓೖΕͯඇಉظॲཧͷՄಡੑΛߴΊΔ • ςετΛॻ͘
  9. UI Presentation Domain Presenter View ViewController PresenterImpl UseCase Mapper Model

    ໼ҹ͸ґଘؔ܎
  10. Domain Data Remote UseCase Mapper Model ໼ҹ͸ґଘؔ܎ Repository RepositoryImpl Mapper

    Model Cache DataSource DataSourceImpl Entity DataSourceImpl Entity
  11. ͦΕͰ͸։ൃ͍͖ͯ͠·͢

  12. ஫1: ͋͘·ͰαϯϓϧίʔυͰ͢

  13. ஫2: શମతʹ͔ͳΓলུ͍ͯ͠·͢

  14. Ҋ݅঺հ

  15. • ۙگ (Recents) ը໘ • ϢʔβʔͷΞΫςΟϏςΟΛྲྀ͢ϑΟʔυUI • API͔ΒϑΟʔυͷListΛऔಘ • આ໌Λ؆қతʹ͢ΔͨΊCache͸͠ͳ͍

    • APIೲ඼͕஗Ε͍ͯΔʂʢઃఆʣ
  16. Domain • UseCase͔ΒऔΓग़ͨ͠Βग़ͯ͘ΔΦϒδΣΫτ • ϑΟʔυͷͻͱͭ෼ʹ૬౰͢Δ

  17. Domain • UseCase͕ґଘ͢ΔRepositoryͷΠϯλʔϑΣʔε • SingleΦϒδΣΫτͱͯ͠ඇಉظʹΦϒδΣΫτΛฦ͢

  18. Domain

  19. Domain RepositoryͷΠϯλʔϑΣʔεʹґଘͤ͞Δ Repository͔ΒσʔλΛऔΓग़͢

  20. ࢀߟ (kotlin) • ϕʔεΫϥε SingleUseCase.kt • https://github.com/bufferapp/android-clean-architecture-boilerplate/ blob/master/domain/src/main/java/org/buffer/android/boilerplate/ domain/interactor/SingleUseCase.kt

  21. ςετΛॻ͍ͯ͜͜ͰPull Request

  22. Presentation • ந৅Խ͞ΕͨViewͷProtocolΛఆٛ • Presenter͸͜ͷViewʹରͯ͠දࣔΛࢦࣔ͢ΔΑ͏ʹॻ͘

  23. Presentation • Presenterʹ࣮૷͢΂͖ProtocolΛఆٛɻ • ViewController͸ϥΠϑαΠΫϧ্ͰPresenterͷ֤ॲཧΛ࣮ߦ͢Δ

  24. Presentation

  25. Presentation ViewΛऑࢀর ݁ՌΛViewʹ൓ө͢Δ

  26. ςετΛॻ͍ͯ͜͜ͰPull Request

  27. User Interface

  28. User Interface Presenterʹॲཧ͕ॻ͍ͯ͋Δ RecentViewΛConform

  29. ͜ͷ࣌఺ͰLayoutͯ͠σʔλΛදࣔͤ͞Δ

  30. ςετ͸ॻ͔ͳ͍ͰOKɺPull Request

  31. APIͰ͖ͨʁ

  32. Data

  33. Data DataϨΠϠʔͰѻ͏ΦϒδΣΫτ

  34. Data DataϨΠϠʔͰѻ͏ΦϒδΣΫτ͔Β DomainϨΠϠʔͰѻ͏ΦϒδΣΫτʹTranslate͢Δ

  35. ςετΛॻ͍ͯ͜͜ͰPull Request

  36. Remote

  37. ͦΖͦΖ࣌ؒͳ͍ͷͰAPIClientͷ۩ମతͳ࣮૷͸লུ͠·͢

  38. ςετΛॻ͍ͯ͜͜ͰPull Request

  39. αʔόʔͱ݁߹ͯ͠ಈ࡞֬ೝʂ

  40. ࣮૷खॱͷ·ͱΊ • ґଘؔ܎͕੔ཧ͞Ε͍ͯΔͷͰॱংཱ࣮ͯͯ૷͠΍͍͢ • API/Cache͕ͳͯ͘΋UseCase͕ฦ͢ϞσϧΛͰͬͪ͋͛Ε͹͙͢ʹ࣮૷ ͸΍͍͚ͬͯΔ • ϨΠϠʔΛ௒͑Δͱ͖͸جຊతʹProtocolґଘ͢Δ • ςετ͸ॻ͘ͱ͜Ζͱॻ͔ͳ͍ͱ͜ΖͷϝϦϋϦΛ͚ͭΔ

  41. ࢒͞Ε͍ͯΔ՝୊ • Clean ArchitectureΛͲ͜·Ͱݫີʹ΍͍͔ͬͯ͘໰୊ • ϑΝΠϧ͕ଟ࣮ͯ͘૷͕େม • ίʔυςϯϓϨʔτͳͲΛۦ࢖ͯ͠ؾָʹ͍͖͍ͯͨ͠ • ґଘؔ܎ղܾ͕͍͍ͪͪෳࡶ

    • SwinjectͳͲDI Containerͷಋೖ͕ඞવతʹͳ͖ͬͯͨ • Embedded FrameworkԽ͍ͯ͠ͳ͍ • ґଘؔ܎ͷϧʔϧΛ؆୯ʹഁͬͯ͠·͏͜ͱ͕Ͱ͖Δ • ۃ୺ʹݴ͏ͱ Presenter͕APIΫϥΠΞϯτΛؾܰʹ௚઀ୟ͘͜ͱ΋Մೳͱ͍͑͹Մೳ
  42. ΞʔΩςΫνϟ࡮৽ͷޮՌ • ͱΓ͋͑ͣίʔυΛॻ͘ͷ͕ਏ͘ͳָ͍ͯ͘͠ • ςετΛॻ͘͜ͱ͕౰વͷۭؾʹͳΓίʔυϨϏϡʔ΋ָνϯ • ා͘ͳ͍ • ޻਺ΛݟੵΔ͜ͱ͕Ͱ͖Δ •

    ࣮૷଎౓΍QA࣌ͷόάͷ਺ͳͲ͸͜Ε͔Β΋͏গ͠෼ੳ͍͖͍ͯͨ͠
  43. ͋Γ͕ͱ͏͍͟͝·ͨ͠