Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WACATE2019_summer_BPP

 WACATE2019_summer_BPP

WACATE2019 夏のBPPセッションスライドです。

Daiki Katayama

June 15, 2019
Tweet

More Decks by Daiki Katayama

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ • kariad / @kariad_uu • ยࢁ େथ • ΦΠγοΫεɾϥɾେ஍

    iOS App Developer • / / V / ςετ / ઃܭ / ྉཧ / ήʔϜ 2
  2. ςετͱͷؔΘΓ • ৽ଔ: SIer ͻͨ͢ΒؤுΔखಈςετɺऴΘΒͳ͍ɺؼΕͳ͍ɺਏ͍…. • ҟಈ: ΞδϟΠϧɺTDDɺςετָ͍͠ • స৬:

    ΞδϟΠϧɺUnitςετಋೖɺςετ΍͍͖ͬͯ • QAΤϯδχΞɺςετΤϯδχΞͱݺ͹ΕΔํͱҰॹʹ࢓ࣄΛͨ͜͠ ͱ͸ͳ͍Ͱ͢ 3
  3. 7

  4. ઃܭύλʔϯ(ΞʔΩςΫνϟ) • MVC / MVP / MVVM / Clean Architecture

    / Flux… • ઃܭํ਑ͱͯ͠ͷϕετϓϥΫςΟεू • ͜ΕΒͷଟ͘͸Testable΋ಉ࣌ʹߟ͑ΒΕ͍ͯΔ 29
  5. func didTapSearchButton(text: String?) { ~~~ লུ ~~~ SearchModel().search(searchWord: searchWord) {

    result in switch result { case .success(let events): ~~ লུ ~~ case .failure: ~~ লུ ~~ } } } 37
  6. func didTapSearchButton(text: String?) { ~~~ লུ ~~~ SearchModel().search(searchWord: searchWord) {

    result in switch result { case .success(let events): ~~ লུ ~~ case .failure: ~~ লུ ~~ } } } ͜͜ͷॲཧΛςετ͍ͨ͠ 38
  7. func didTapSearchButton(text: String?) { ~~~ লུ ~~~ SearchModel().search(searchWord: searchWord) {

    result in switch result { case .success(let events): ~~ লུ ~~ case .failure: ~~ লུ ~~ } } } SearchModelͷ࣮૷ʹ ґଘ͍ͯ͠Δ 39
  8. func didTapSearchButton(text: String?) { ~~~ লུ ~~~ SearchModel().search(searchWord: searchWord) {

    result in switch result { case .success(let events): ~~ লུ ~~ case .failure: ~~ লུ ~~ } } } SearchModelͷ࣮૷͕มΘΔͱ ͪ͜Βͷ݁Ռ΋มΘͬͯ͠·͏ 40
  9. func didTapSearchButton(text: String?, model: SearchModel) { ~~~ লུ ~~~ model.search(searchWord:

    searchWord) { result in switch result { case .success(let events): ~~ লུ ~~ case .failure: ~~ লུ ~~ } } } ֎ଆ͔ΒΦϒδΣΫτΛ ౉͢Α͏ʹ 41
  10. func didTapSearchButton(text: String?, model: SearchModelProtocol) { ~~~ লུ ~~~ model.search(searchWord:

    searchWord) { result in switch result { case .success(let events): ~~ লུ ~~ case .failure: ~~ লུ ~~ } } } ౉͢ܕΛந৅Խ͞Εͨ ܕʹ͢Δ 42
  11. class FakeSearchEventModel: SearchEventModelProtocol { var search_successValue = [ConnpassEvent]() func search(searchWord:

    String, completion: @escaping ((Result<[ConnpassEvent]>) -> ())) { search_callCount += 1 search_arguments = searchWord completion(.success(search_successValue)) } } class FakeFailureSearchEventModel: SearchEventModelProtocol { func search(searchWord: String, completion: @escaping ((Result<[ConnpassEvent]>) -> ())) { search_arguments = searchWord completion(.failure) } } ελϒ ґଘ͢ΔΦϒδΣΫτͷ݁ՌΛ ίϯτϩʔϧͰ͖Δ
  12. • iOSΞϓϦઃܭύλʔϯೖ໳
 ؔ ོٛɾদؗ େًɾླ໦ େوɾਿ্ ༸ฏɾ࢙ ᠳ৽ɾాத ݡ ࣏ɾՃ౻

    ׮ਓ ஶ
 https://peaks.cc/books/iOS_architecture • Clean Architecture ୡਓʹֶͿιϑτ΢ΣΞͷߏ଄ͱઃܭ
 Robert.C.Martinஶ ֯ ੐యɾߴ໦ ਖ਼߂ ༁ ࢀߟॻ੶