Why use Redux in iOS

Why use Redux in iOS

Acbf3391de0494432a92221ffe89f34e?s=128

yohei sugigami

March 22, 2018
Tweet

Transcript

  1. ɹ ɹ Why use Redux in iOS ɹ ɹ ɹ

    iOS Flux/Reduxษڧձ 2018/03/22@Wantedly Yohei Suginami ( @susieyy )
  2. Profile — Yohei Sugigami — susieyy — Twitter / Qiita

    / Github — New app development specialist — Clients — Folio.inc — New app developer — Wantedly.inc — Technical advisor
  3. ɹ ɹ ɹ ɹ Flux/Redux੝Γ্͕ͬͯ·͢Ͷʂ

  4. ɹ ɹ ɹ ɹ ϨΩγΛৼΓฦΔ

  5. None
  6. None
  7. None
  8. None
  9. None
  10. None
  11. None
  12. None
  13. None
  14. None
  15. ɹ ɹ ɹ ɹ ೔ຊͰ΋࠾༻ࣄྫ͕૿͑ͯ·͢Ͷʂ

  16. ɹ ɹ ͳͥReduxͳͷ͔

  17. ɹ ɹ ΞϓϦ։ൃʹ͓͚Δ ࠷େͷ՝୊͸ɹɹɹ

  18. ɹ ɹ ෳࡶͰ͋Δ͜ͱ

  19. Ͳ͏γϯϓϧʹམͱ͠ࠐΉ͔ɹɹɹ ɹ ɹ ɹ ɹ ೺Ѳɾ؅ཧͰ͖ΔΑ͏ʹ͢Δ͔

  20. ΞϓϦ։ൃʹ͓͚Δෳࡶੑͱ͸ खଓ͖తهड़ʹΑΔॲཧͷྲྀΕͷ೺Ѳͷ͠ʹ͘͞ — σϦήʔτύλʔϯͷίʔϧόοΫ஍ࠈ — ϑΝοτίϯτϩʔϥʔ໰୊

  21. ΞϓϦ։ൃʹ͓͚Δෳࡶੑͱ͸ Өڹൣғͷෆ͔֬͞΍ɺہॴԽ͞Εͣ޿ҬͳӨڹൣғ — γϯάϧτϯʢάϩʔόϧม਺ͷଟ༻ʣ

  22. ΞϓϦ։ൃʹ͓͚Δෳࡶੑͱ͸ ଟ༷ͳঢ়ଶͷදݱͷͨΊʹଟ਺ͷ෼ذͱଟ਺ͷม਺ͷग़ݱ — ม਺͕มԽ͢ΔཁҼ͕఺ࡏԽ — ৚݅෼ذʹ͸࢓্༷ભҠ͠ͳ͍ܦ࿏΋ؚ·ΕΔ

  23. ॾѱͷࠜݯ͸MVC ෳࡶੑͷղܾࡦΛMVCʹมΘΔΞʔΩςΫνϟ΁ٻΊͨ — MVVMʢCʣʴFRP — CleanAcrhitecture / Viper — Flux

    / Redux
  24. MVVMʢCʣʴFRP ෳࡶੑ΁ͷରቂ — ϦΞΫςΟϒͳؔ਺ʹந৅Խ͠ɺ୺తͰએݴతͳهड़ — ࿈ଓ͢Δ૬ޓ࡞༻Λѻ͍΍͍͢ — ঢ়ଶอ࣋ͷͨΊͷม਺Λ࡟ݮ — ↑

    RxͷετϦʔϜʹ಺แ — ඇಉظΛབྷΊͨॲཧͷՄಡੑߴ͍දݱྗ — εϐʔυײ͋Δ։ൃ
  25. MVVMʢCʣʴFRP σϝϦοτ — ߴ͍ͷந৅ԽʹΑΔهड़೉қ౓ͷ্ঢ — ෳࡶͳRxͷΦϖϨʔλʔΛۦ࢖͢Δ͜ͱͰ͔͑ͬͯڍಈ͕ Θ͔Γʹ͍͘ — ϚϧνεϨουͳॲཧ͸֤ετϦʔϜͰಠཱతʹಈ࡞͢Δ —

    هड़ྗ͸ߴ͍͕ಈ࡞ͷ೺Ѳɾσόοά͸͠ʹ͍͘
  26. CleanAcrhitecture / Viper ෳࡶੑ΁ͷରቂ — ΦϒδΣΫτࢦ޲ͷ੹຿෼ׂͰγϯϓϧʹམͱ͠ࠐΉ — ϨΠϠʔ෼ׂɾґଘͷࢦ޲ੑ — ϨΠϠʔͷΠϯλʔϑΣΠεͱ࣮૷ͷ෼཭ʹΑΔந৅Խ

    — νʔϜεέʔϥϏϦςΟͷ޲্
  27. CleanAcrhitecture / Viper σϝϦοτ — ৑௕ʹΑΔهड़ྔ͕૿͑Δίʔυ — ։ൃεϐʔυͷݮ଎ — ঢ়ଶͱखଓ͖ΛΧϓηϧԽʹΑΔγϯϓϧԽͷݶք

  28. ɹ ɹ Reduxͱ͸Կ͔

  29. None
  30. None
  31. Մಡੑͷ޲্ ॻ͘ίετΑΓ΋ɺಡΉίετΛԼ͛Δ — ಡΈ΍͘͢ɺ΍Γ͍ͨ͜ͱɾॲཧ͕೺Ѳ͠΍͍͢ — Өڹൣғ͕ਪఆ͠΍͍͢ — ϨϏϡʔ͠΍͍͢ — εϐʔυײ͋Δ։ൃ

    — ΞϓϦن໛ͱνʔϜߏ੒ͷεέʔϥϏϦςΟͷ޲্
  32. Viewͱঢ়ଶͷ׬શͳΔ෼཭ — ViewͷॲཧͰ͸ͦͷॠؒͷΞϓϦ಺ͷ͢΂ͯͷঢ়ଶ ʢState)͕ҰҙͰ͋Δ͜ͱΛอূ͞ΕΔ — State͸Πϛϡʔλϒϧ — ͦͷॠؒͷঢ়ଶʹରͯ͠ඇಉظͷհೖ͕ͳ͍ — ViewʹState౉Δͱදࣔ͸Ұҙʹܾ·Δ

    — View͕ؔ਺ܕࢦ޲ʹͳΔ
  33. ७ਮؔ਺ — ೖྗʹରͯ݁͠Ռ͕ҰҙͰ͋Δ — ϓϩάϥϛϯάʹ͓͍ͯϩδοΫΛγϯϓϧѻ͏ͨΊͷۃ Έ — ෭࡞༻ഉআͱ෼཭ — ςελϏϦςΟ޲্

  34. Ϛγϯύϫʔ্͕͕ͬͨ͜ͱʹΑΔ෋߽తͳΞʔΩςΫνϟ ϚγϯύϫʔΛ͏·͘ར༻͢Δ͜ͱͰγϯϓϧΛ࣮ݱ͍ͯ͠Δ ॲཧͷ௚ྻԽ - ϝΠϯεϨου্ͰϏδωεϩδοΫ(ߋ৽ॲཧ)ͷಈ࡞ - γϯάϧϝΠϯεϨου͚ͩͰಈ࡞͍ͯ͠ΔΑ͏ͳײ֮ͰΞ ϓϦ͕ॻ͚Δ Viewͷޮ཰తͳߋ৽ͷͨΊͷࠩ෼ݕ஌ίετ -

    ϏδωεϩδοΫ͸ॲཧޙͷViewͷӨڹൣғΛؔ஌͠ͳ͍
  35. Swi!ݴޠͱͷ૬ੑͷྑ͞ — TypeSafe — Struct / Immutable — ComputedProperty —

    Enum / PatternMatch — Generics — Functional Oriented — Protocol Oriented
  36. σόοά༰қੑ ɹ DEMO

  37. Redux՝୊఺ — ΞΫγϣϯͷॱংੑΛ੍໿͚͍ͮͨʢεςʔτϚγϯʣ — Actionϧʔϓ໰୊ — StateͷΠχγϟϥΠζͱΦϓγϣϯφϧ — ϝϞϦϚωδϝϯτʢը໘ഁغ࣌ʹ෦෼Stateͷഁغʣ —

    Viewͷޮ཰తͳߋ৽ͷͨΊͷࠩ෼ߋ৽ʢվળͷ༨஍͋Γʣ
  38. Redux͸ۜͷ஄ؙͰ͸ͳ͍ ɹ ɹ ɹ దࡐ͔Ͳ͏͔͸ɹɹɹɹɹ ΞϓϦཁ݅ɺ඼࣭ཁ݅ɹɹɹɹ νʔϜߏ੒ɺ։ൃظؒ࣍ୈɹɹ

  39. ·ͱΊ Redux͸ඇৗʹݫ֨ɾݎ࿚Ͱ͋ΓγϯϓϧͳϩδοΫܗ੒ — ७ਮؔ਺ — Πϛϡʔλϒϧ — ୯Ұࢦ޲ੑϑϩʔ ʢ ϚϧνεϨουͷہॴԽ

    ʣ — ෭࡞༻ʢඇಉظॲཧʣͷہॴԽ
  40. ߹ΘͤͯಡΈ͍࣮ͨફฤ ɹ Redux+RxΛ׆༻ͨ͠ΞϓϦΞʔ ΩςΫνϟ CA.swi! #5 2018/01/25@גࣜձࣾαΠόʔΤʔδΣϯτ Yohei Suginami (

    @susieyy )