RxSwift, Codable, Moya で API クッキング!

RxSwift, Codable, Moya で API クッキング!

potatotips 50

Eae7b6aeee72d3081b01d09a2d675f9a?s=128

Akio Itaya

April 19, 2018
Tweet

Transcript

  1. AKKEY / AKIO ITAYA Cyberagent, Inc. RxSwift, Codable, Moya API

    cookingʂ
  2. ໊લɿ൘୩ ߊྑɹ/ɹ͖͋ͬʔʢAKKEYʣ ৬छɿiOS ׆ಈɿ@AkkeyLab Ұݴɿప໷։ൃޙͷԾ຾தʹίʔσΟϯά͠·ͤΜʁ ࣗݾ঺հ ※ֶੜ࣌୅ͷݸਓ։ൃʹͯ

  3. ֶੜ࣌୅ͷݸਓ։ൃ͕ݩͷ͓࿩ ʻ ஫ҙ ʼ

  4. ٕज़બఆ • RxSwift ɹɹʔʼɹKVO ຣফܭըͰ΋ͬͱษڧ͍ͨ͠ͱࢥͬͨ • Codable ɹɹʔʼɹApple ७ਖ਼ʹऒ͔Εͯ •

    Moya ɹɹʔʼɹAlamofire Λར༻ͯ͠ Rx Ͱॻ͖͔ͨͬͨ
  5. YouTube API Λͨͨ͘

  6. TargetType protocol ڞ௨߲໨Λ extension Ͱఆٛ Codable

  7. TargetType protocol ↓API ϦΫΤετͷ1ͭˣ Response Λ Codable Ͱࢦఆ

  8. TargetType protocol - MultiTarget Singleton Ͱ provider ։์ʹΑΔ subscribe ෆՄΛ๷ࢭ

    Singleton
  9. TargetType protocol - MultiTarget Singleton Ͱ provider ։์ʹΑΔ subscribe ෆՄΛ๷ࢭ

    Singleton TargetType ͷܕʹґଘ͠ͳ͍
  10. TargetType protocol - MultiTarget Singleton Ͱ provider ։์ʹΑΔ subscribe ෆՄΛ๷ࢭ

    Response Λ subscribe Մೳ Singleton TargetType ͷܕʹґଘ͠ͳ͍
  11. TargetType protocol - MultiTarget Singleton Ͱ provider ։์ʹΑΔ subscribe ෆՄΛ๷ࢭ

    Response ͷ Json ΛϚοϐϯά Response Λ subscribe Մೳ Singleton TargetType ͷܕʹґଘ͠ͳ͍
  12. Codable ↓API ϦΫΤετͷ1ͭˣ

  13. API ͷݺͼग़͠ Rx ͳॲཧͰγϯϓϧʹهड़Մ औಘ݅਺

  14. API ͷݺͼग़͠ Rx ͳॲཧͰγϯϓϧʹهड़Մ औಘ݅਺ ֤छ஋Λར༻ͨ͠ݸਓతͳ࣮૷

  15. Result YouTube ranking Top 50 !!

  16. ࠷ۙͷ͓ؾʹೖΓͰ͢ʢস

  17. GitHub / Qiita : @AkkeyLab

  18. Thank you !!