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

やさしくわかるMVVM

 やさしくわかるMVVM

iOSDC 2017 Reject Conference days1の発表資料です

B6ce8bebf30b97bac7624b0c6622352e?s=128

Kazuhiro Sakamoto

October 13, 2017
Tweet

Transcript

  1. ΍͘͞͠Θ͔Δ.77. @kazu0620

  2. ࣗݾ঺հ ɾࡔຊ ࿨େ( @kazu0620 ) ɾݩʑ͸ιʔγϟϧήʔϜͷ։ൃͳͲ ɾ2015೥ Sansanೖࣾ ɾEightࣄۀ෦ʹͯiOSΞϓϦͷ։ൃΛ୲౰

  3. ࠓ೔͓࿩͢Δ͜ͱ .77.ͷ.77.͕ͦΕͧΕͲ͏͍͏໾ׂ͔ʹ஫໨ ίʔυྫʹ͸3Y4XJGUΛ࢖ͬͯΔ͕ɺͦͪΒ͸৮Γ͚ͩ

  4. ΍Γ͍ͨ͜ͱ 6*ͱϩδοΫσʔλ Λ៉ྷʹ෼͚͍ͨ

  5. ͦΕɺ.7$͡ΌμϝͳΜʁ

  6. ผʹྑ͍

  7. ͚Ͳɺਏ͍͜ͱ΋͋Δ

  8. 7JFX$POUSPMMFSBT.FEJBUPS 7JFX$POUSPMMFS͸.PEFM૚ͷॲཧΛݺͼग़͢ 7JFX$POUSPMMFS͸݁ՌΛ$BMMCBDL௨஌Ͱड͚औΔ 7JFX$POUSPMMFS͸݁ՌΛݩʹ7JFXͷঢ়ଶΛૢ࡞ 7JFX$POUSPMMFSͷதͰ6*ͱϩδοΫ͕ࠞ͟Γ͕ͪ

  9. ΋͏ͪΐͬͱྑ͍ײ͡ʹ 6*ͱϩδοΫσʔλ Λ៉ྷʹ෼͚͍ͨ

  10. ViewModel Model Presentation Logic Domain Logic (And Data) View ViewController

    UI UI .77.
  11. ࡶͳΠϯΫϦϝϯλϧαʔνͰߟ͑Δ

  12. 7JFXͷ૚ΛͲ͏΍ͬͯ࡞Δ͔ʁ 7JFXࢹ఺͔Β7JFX.PEFMΛݟͯߟ͑Α͏

  13. None
  14. None
  15. None
  16. None
  17. None
  18. 7JFX$POUSPMMFSͷ࣮૷

  19. 7JFX$POUSPMMFSͷ࣮૷

  20. 7JFX$POUSPMMFSͷ࣮૷ ೖྗ͞Εͨ5FYUΛ7JFX.PEFMʹ఻͑Δ

  21. 7JFX.PEFM͔Β఻ΘΔ ஋Λը໘ʹ൓ө͢Δ͚ͩ %BUB#JOEJOH

  22. 7JFX͕΍Δ͜ͱ ɾϩδοΫ͸࣋ͨͣͨͩ6*Λఆٛ͢Δ ɾϢʔβʔ͔Βͷૢ࡞Λ7JFX.PEFMʹ఻͑Δ ɾ7JFX.PEFM͔Βड͚औͬͨ஋Λ7JFXʹ൓ө͢Δ ɾ ը໘ભҠͷॲཧ 7JFX͕΍Βͳ͍͜ͱ ɾϞσϧ΍σʔλΛ7JFX͕ૢ࡞͢Δ͜ͱ͸ͳ͍

  23. None
  24. 7JFX.PEFMͷ֊૚ΛͲ͏΍ͬͯ࡞Δ͔ʁ 7JFX.PEFMࢹ఺͔Βݟͯߟ͑Α͏

  25. None
  26. None
  27. None
  28. None
  29. None
  30. None
  31. 7JFX.PEFMͷ࣮૷

  32. 7JFX.PEFMͷ࣮૷ 7JFXʹެ։͢ΔϓϩύςΟΛఆٛ

  33. None
  34. .PEFMʹॲཧΛґཔ

  35. .PEFMʹॲཧΛґཔ ݁ՌΛ7JFXͷ౎߹ʹ߹Θͤͨܗʹม׵ͯ͋͛͠Δ

  36. 7JFX.PEFM͕΍Δ͜ͱ ɾ.PEFMʹυϝΠϯϩδοΫʹؔ͢ΔॲཧΛґཔ ɾ.PEFMͷ࠷৽ͷ஋Λɺදࣔͷ౎߹ʹ߹Θͤͨܗʹ͢Δ 7JFX.PEFM͕΍Βͳ͍͜ͱ ɾυϝΠϯϩδοΫɾσʔλͷૢ࡞ͳͲ͸.PEFMʹ ೚ͤΔ

  37. None
  38. .PEFMͷ࣮૷

  39. .PEFM͕΍Δ͜ͱ ɾΞϓϦݻ༗ͷσʔλ΍ϏδωεϩδοΫΛఆٛ ɾ.PEFMͷ໾ׂ͸ଞͷ.7YͱಛʹมΘΒͳ͍͸ͣ .PEFM͕΍Βͳ͍͜ͱ ɾ7JFX 6* ʹؔ͢Δૢ࡞͸౰વߦΘͳ͍

  40. ͓͞Β͍

  41. None
  42. None
  43. .77.ͷྑ͞ ɾ.77.Ͱɺ6*ͱϩδοΫͯ͠ݟ௨͠Α͘ॻ͘͜ͱ͕Ͱ͖Δ ɾ6*ͱϩδοΫ͕෼཭͞ΕΔͷͰɺςετ͠΍͘͢ͳΔ ɾσʔλόΠϯσΟϯάΛར༻ͯ͠ɺૄ݁߹ͳ࣮૷Λ࣮ݱͰ͖Δ