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

iOS でテスト容易な設計を
実現するためのデザインパターン

Kuniwak
October 02, 2017

iOS でテスト容易な設計を
実現するためのデザインパターン

Kuniwak

October 02, 2017
Tweet

More Decks by Kuniwak

Other Decks in Technology

Transcript

  1. J04Ͱςετ༰қͳઃܭΛ

    ࣮ݱ͢ΔͨΊͷσβΠϯύλʔϯ

    View full-size slide

  2. ࣗݾ঺հ
    ·ͣ͸

    View full-size slide

  3. TUSVDU΍DMBTTؒͷ

    ߏ଄తͳࠩ෼Λܭࢉ͢Δ

    ϥΠϒϥϦͷ࡞ऀͰ͢
    σόοάʹศརͳ

    View full-size slide

  4. ϑΟʔϧυͷࠩҟΛ

    จࣈྻͱͯ͠औಘͰ͖·͢ʂ
    TUSVDU΍DMBTTΛҾ਺ʹ

    EJ⒎ؔ਺Λ࣮ߦ͢Δͱʜ

    View full-size slide

  5. IUUQHJUIVCDPN,VOJXBL.JSSPS%J⒎,JU
    ͘͢͝ศརͰ͢ʂ

    View full-size slide

  6. σβΠϯύλʔϯͷ

    ঺հͷલʹ

    View full-size slide

  7. ཧ૝తͳςετͱ͸ɺ

    ͲΜͳ΋ͷͩΖ͏͔ʁ

    View full-size slide

  8. खಈςετͱ

    ࣗಈςετͷؔ܎
    Έͳ͞Μ͝ଘ஌

    View full-size slide

  9. ࣌ؒܦա
    ʢػೳ͸૿େ͍ͯ͘͠ʣ
    ίετߴ
    ࣗಈςετ
    खಈςετ
    खಈςετ͕༗ར ࣗಈςετ͕༗ར
    ػೳ͕૿͍͑ͯͬͨͱͯ͠΋

    ࣗಈςετ͸ܧଓ͠΍͍͢

    View full-size slide

  10. ςετର৅ͷཻ౓ͱ

    ίεύͷؔ܎
    ͓͓͑ͯ͘͞΂͖

    View full-size slide

  11. ؔ਺" ؔ਺#
    ʜ
    ग़ྗO௨Γ ग़ྗN௨Γ
    ʜ

    View full-size slide

  12. ςετର৅ͷཻ౓͕

    খ͍͞ͱ͖

    View full-size slide

  13. ୯ମςετ
    ؔ਺" ؔ਺#
    ςετͷ਺ɿON௨Γ
    ୯ମςετ
    O௨Γ N௨Γ
    Ϟδϡʔϧ͸ݸผʹςετ͞ΕΔͷͰ

    View full-size slide

  14. ςετର৅ͷཻ౓͕

    େ͖͍ͱ͖

    View full-size slide

  15. Ϟδϡʔϧ"
    ʜ
    ςετͷ਺ɿOʷN௨Γ
    Ϟδϡʔϧ#
    ʜ
    ϡʔϧ#
    ʜ
    Ϟδϡʔϧ#
    ʜ
    Ϟδϡʔϧ#
    ʜ
    Ϟδϡʔϧ#
    ʜ
    Ϟδϡʔϧ#
    ʜ
    Ϟδϡ
    खಈ6*ςετ
    Ϟδϡʔϧ͸࿈݁ͨ͠··ςετ͞ΕΔͷͰ

    View full-size slide

  16. ΋͠ɺςετͰ͖Δ਺͕

    Nͩͬͨͱ͢Δͱʜ

    View full-size slide

  17. ୯ମςετ
    ؔ਺" ؔ਺#
    ΧόʔͰ͖Δൣғยํ
    ୯ମςετ
    O௨Γ N௨Γ

    View full-size slide

  18. Ϟδϡʔϧ"
    ʜ
    ΧόʔͰ͖Δൣғ͘͝Ұ෦
    Ϟδϡʔϧ#
    ʜ
    ϡʔϧ#
    ʜ
    Ϟδϡʔϧ#
    ʜ
    Ϟδϡʔϧ#
    ʜ
    Ϟδϡʔϧ#
    ʜ
    Ϟδϡʔϧ#
    ʜ
    Ϟδϡ
    खಈ6*ςετ

    View full-size slide

  19. ͭ·Γςετର৅ͷཻ౓͕

    খ͍͞ςετʢ୯ମςετʣ͸ɺ

    ίετύϑΥʔϚϯε͕ߴ͍ʂ

    View full-size slide

  20. ͜͜·Ͱͷ·ͱΊ
    w खಈςετͱൺ΂ͯࣗಈςετ͸

    ܧଓ͠΍͍͢
    w ࣗಈςετͷதͰ΋୯ମςετ͸

    ίετύϑΥʔϚϯε͕ߴ͍
    w ͭ·ΓɺࣗಈςετͰ͋Δ୯ମςετ͸ɺ

    ܧଓ͠΍͘͢ίετύϑΥʔϚϯε͕ߴ͍

    View full-size slide

  21. ݟ͖͑ͯͨ͜ͱ
    ཧ૝ͷσόοά؀ڥ͸େྔͷ

    ୯ମςετʹΑͬͯ࡞ΒΕΔ
    ܧଓ͠΍͘͢ίετύϑΥʔϚϯε͕ߴ͍

    View full-size slide

  22. ୯ମςετ͸͙͢ʹ

    Ͱ͖Δͷ͔ʁ
    ͜͜Ͱٙ໰ʂ

    View full-size slide

  23. ୯ମςετͷର৅͸ؔ਺΍Ϋϥε
    ͭ·Γɺؔ਺΍Ϋϥεͷ

    ઃܭͷӨڹΛड͚΍͍͢

    View full-size slide


  24. ΄Μͱ͔ͳʁ

    View full-size slide

  25. ςετ͠ͳ͍ͱා͍͙Β͍ʹ͸ෳࡶͳؔ਺
    ͳʹ΍ΒόϦσʔγϣϯΛ͢ΔΑ͏ͩ

    View full-size slide

  26. ςετ͢Δʹ͸ςετର৅ʹ

    ద౰ͳೖྗΛ͢Δඞཁ͕͋Δ
    ͜ͷೖྗ͕ϑΟʔϧυܦ༝Ͱ

    ͔͠΋QSJWBUFͩͬͨΓ͢Δͱ

    ೖྗΛ੍ޚ͢Δ͜ͱ͕ͦ΋ͦ΋೉͍͠

    View full-size slide

  27. όϦσʔγϣϯͷ݁Ռ͕

    Πϯελϯεϝιουͷ

    ݺͼग़͠ͷ༗ແͰ͔͠

    ൑ఆͰ͖ͳ͍ͱ͖ɺ

    όϦσʔγϣϯ݁Ռͷ

    औಘʹ͸ςΫχοΫ͕

    ඞཁͱ͞ΕΔ

    View full-size slide

  28. ͜͜·Ͱͷ·ͱΊ
    ୯ମςετ͕؆୯͔Ͳ͏͔͸

    ର৅ͷઃܭʹେ͖͘ࠨӈ͞ΕΔ

    View full-size slide

  29. ॏཁͳͷ͸୯ମςετ͕

    ؆୯ͳઃܭʹ͢Δ͜ͱ

    View full-size slide

  30. ͭͷσβΠϯύλʔϯ
    ͷ঺հ
    ୯ମςετΛ؆୯ʹ͢Δ

    View full-size slide

  31. w 0VUQVU0CKFDU*OKFDUJPO
    w 4QZ7JFX$POUSPMMFS
    w *OQVU0CKFDU*OKFDUJPO
    w 4JOHMF.FUIPE4UVC4QZ
    w %FQFOEFODZ#BH
    w -PHHJOH0CTFSWFS
    w 3Y&WFOU#MPDLFS
    w 4UBUF.BDIJOF.PEFM
    w 1SFQSPDFTTPS5PLFO

    View full-size slide

  32. ҉໧తͳग़ྗΛ

    ଊ͑Δύλʔϯ
    ύλʔϯ

    View full-size slide

  33. ςετର৅͸จࣈྻͷόϦσʔγϣϯؔ਺
    ೖྗจࣈྻ͕੔਺Ͱ͋Ε͹

    TVDDFTT
    Λɺͦ͏Ͱͳ͚Ε͹

    GBJMFE
    ΛݺͿΑ͏ͩ

    ʢܧঝΛલఏͱ࣮ͨ͠૷ʣ

    View full-size slide

  34. ςετΛߟ͑ͯΈΔ
    ·ͣ͸

    View full-size slide

  35. ରԠ͢Δςετ
    Ͳ͏΍ͬͯTVDDFTT͕

    ݺ͹Εͨ͜ͱΛݕূ͢Ε͹

    ͍͍ͩΖ͏͔

    View full-size slide

  36. ςετͰ͖·ͤΜ

    View full-size slide

  37. ςετ͔ΒઃܭΛ

    ٯࢉ͢Δ
    ͦΕͳΒ

    View full-size slide

  38. ࠷ॳʹݕ౼͢΂͖͸ɺ݁ՌΛؔ਺ͷ

    ໭Γ஋ʹ͢Δ͜ͱͰ͢
    ͨͩ͠ɺঢ়گʹΑͬͯ͸͜ͷํ๏͕

    ࢖͑ͳ͍͜ͱ΋͋Γ·͢
    ͦ͜Ͱɺࠓճ͸͜ͷํ๏͕࢖͑ͳ͔ͬͨ

    ͱͯ͠ɺผͷํ๏Λݕ౼͠·͢
    ѹ౗తʹ؆୯

    View full-size slide

  39. 0VUQVU0CKFDU*OKFDUJPO
    ͦ͏͍͏ͱ͖͸

    View full-size slide

  40. ςετର৅ͷจࣈྻͷόϦσʔγϣϯؔ਺
    ͕͜͜όϦσʔγϣϯؔ਺ͷ

    ग़ྗʹ౰ͨΔ

    View full-size slide

  41. ग़ྗઌͷΦϒδΣΫτͷ1SPUPDPMΛ࡞੒

    View full-size slide

  42. ग़ྗઌΦϒδΣΫτΛ

    Ҿ਺͔Β஫ೖͰ͖ΔΑ͏ʹमਖ਼
    ੒ޭࣦഊॲཧ͸ग़ྗઌΦϒΤδΣΫτʹ௨஌
    ઃܭमਖ਼ޙͷςετର৅

    View full-size slide

  43. ຊମଆͷ४උ׬ྃ
    ͓ΊͰͱ͏͍͟͝·͢

    View full-size slide

  44. ςετͷ४උ
    Ͱ͸ͬͦ͘͞

    View full-size slide

  45. ग़ྗ಺༰Λه࿥͢ΔِͷΦϒδΣΫτʢ4QZʣΛ࡞੒
    ϝιου͕ݺ͹ΕΔͱ͜͜ʹه࿥͞Ε͍ͯ͘

    View full-size slide

  46. ઃܭमਖ਼ޙͷςετ
    ग़ྗઌʹઌ΄Ͳͷ4QZΛࢦఆ
    TVDDFTT
    ͚͕ͩͨͩҰ౓͚ͩݺ͹Εͨ͜ͱΛݕূͰ͖Δʂ

    View full-size slide

  47. 0VUQVU0CKFDU*OKFDUJPO
    w ͲΜͳ࣌ʹ࢖͏͔ɿ
    w ςετ͔Βଊ͑ͮΒ͍ग़ྗ͕͋Δͱ͖
    w ԿΛ͢Δ͔ɿ
    w ग़ྗΛ࢘ΔΦϒδΣΫτΛ1SPUPDPMԽ
    w ग़ྗΛه࿥͢ΔِͷΦϒδΣΫτʢ4QZʣΛ࡞੒
    w ςετͷ࣌͸4QZΛར༻

    View full-size slide

  48. 5JQT4QZ7JFX$POUSPMMFS
    ͜͏͍͏ͷ΋࡞Ε·͢

    View full-size slide

  49. 6*7JFX$POUSPMMFSͷ-JGF$ZDMFΛ؂ࢹ͢Δ4QZ

    View full-size slide

  50. ҉໧తͳೖྗΛ

    ੍ޚ͢Δύλʔϯ
    ύλʔϯ

    View full-size slide

  51. ςετର৅
    αʔόʔͱͷ௨৴͸ڞ௨ͷ

    "1*Ϋϥε͕୲౰͓ͯ͠Γɺ

    αʔόʔ͔Βฦ͖ͬͯͨ஋Λ

    େจࣈʹͯ͠ฦ͍ͯ͠ΔΑ͏ͩ
    αʔόʔʹϢʔβʔ໊Λ໰͍߹Θͤɺ

    େจࣈʹͯ͠ฦؔ͢਺

    View full-size slide

  52. ςετΛߟ͑ͯΈΔ
    ·ͣ͸

    View full-size slide

  53. ରԠ͢Δςετ
    ಺෦తʹ࢖͍ͬͯΔ"1*Ϋϥε͸

    αʔόʔ͔Β஋Λऔಘͯ͘͠ΔͨΊɺ

    େจࣈʹͳΔલͷ஋͸༧૝Ͱ͖ͳ͍
    ͦͷͨΊݕূʹ࢖͏ਖ਼ղΛܾΊΒΕͳ͍
    ςετର৅Λ࡞੒
    ίʔϧόοΫ͔Β

    ݁ՌΛݕূ͍ͨ͠
    ςετର৅Λ࣮ߦ

    View full-size slide

  54. *OQVU0CKFDU*OKFDUJPO
    ͦ͜Ͱ

    View full-size slide

  55. ಺෦తʹ࢖͍ͬͯΔ"1*ΫϥεΛͦͷ··1SPUPDPMԽ
    ͜ͷ1SPUPDPMΛݩʹͳͬͨ"1*Ϋϥεʹ࣮૷͓ͤͯ͘͞

    View full-size slide

  56. ؔ਺ͷҾ਺͔Βɺ಺෦తʹ࢖͏

    "1*ΫϥεΛ౉ͤΔΑ͏ʹमਖ਼
    ಺෦తʹ͸౉͞Εͨ"1*ΫϥεΛར༻ͯ͠஋Λऔಘ͢Δ
    ͭ·Γɺ౉͢"1*ΫϥεΛม͑Ε͹औಘ͞ΕΔ஋΋ม͑ΒΕΔ
    मਖ਼ޙͷςετର৅

    View full-size slide

  57. ຊମଆͷ४උ׬ྃ
    ͓ΊͰͱ͏͍͟͝·͢

    View full-size slide

  58. ςετର৅ʹ౉͢஋Λςετ༻ͷ΋ͷʹ͢ΔͨΊʹ
    ઌ΄Ͳͷ1SPUPDPMΛ࣮૷ِͨ͠ͷΫϥεʢ4UVCʣΛ࡞੒
    ࣄલʹࢦఆͨ͠஋͕ςετର৅ʹ౉Δ
    ςετର৅ʹ౉͍ͨ͠஋Λ

    ࣄલʹࢦఆ͢Δ

    View full-size slide

  59. ςετͰ͸ઌ΄Ͳͷ

    ِͷΫϥεΛ࢖͏
    ςετର৅ʹ౉͢஋Λ

    ͜͜ͰࢦఆͰ͖Δ
    ฦͬͯ͘Δ஋͕Θ͔ͬͯΔͷͰ

    ਖ਼ղΛ؆୯ʹਪଌͰ͖Δ

    ཁ͢Δʹɺҙਤ௨Γେจࣈʹ

    Ͱ͖ͨ͜ͱΛ͔֬ΊΒΕΔ
    ઃܭमਖ਼ޙͷςετ

    View full-size slide

  60. *OQVU0CKFDU*OKFDUJPO
    w ͲΜͳ࣌ʹ࢖͏͔ɿ
    w ςετ͔Βૢ࡞ͮ͠Β͍ೖྗ͕͋Δͱ͖
    w ԿΛ͢Δ͔ɿ
    w ೖྗΛ࢘ΔΦϒδΣΫτΛ1SPUPDPMԽ
    w ೖྗΛ੍ޚՄೳͳِͷΦϒδΣΫτʢ4UVCʣΛ࡞੒
    w ςετͷ࣌͸4UVCΛར༻

    View full-size slide

  61. 6*,JU΁ͷग़ྗΛ

    ଊ͑Δύλʔϯ
    ύλʔϯ

    View full-size slide

  62. ςετର৅
    Ϙλϯ͕ԡ͞ΕͨΒɺ

    6*/BWJHBUJPO$POUSPMMFSͷ

    QVTI7JFX$POUSPMMFSϝιουͰ

    ભҠ͍ͨ͠Α͏ͩ

    View full-size slide

  63. ςετΛߟ͑ͯΈΔ
    ·ͣ͸

    View full-size slide

  64. ରԠ͢Δςετ
    QVTI7JFX$POUSPMMFS͕

    ݺ͹Εͨ͜ͱΛͲͷΑ͏ʹ

    ݕূͰ͖ΔͩΖ͏͔
    ϘλϯͷԡԼΛ࠶ݱ͢Δ

    View full-size slide

  65. ςετ͔ΒઃܭΛ

    ٯࢉ͢Δ
    ͦ͏͍͏ͱ͖͸

    View full-size slide

  66. جຊతʹ͸0VUQVU0CKFDU*OKFDUJPOͰɺ

    6*/BWJHBUJPO$POUSPMMFS΁ͷ

    ϝιουݺͼग़͠Λه࿥͢Ε͹Α͍
    ͔͠͠ɺ6*/BWJHBUJPO$POUSPMMFSʹ͸

    ͨ͘͞ΜͷϑΟʔϧυͱϝιου͕͋Δ

    View full-size slide

  67. 6*/BWJHBUJPOͷશͯͷϑΟʔϧυͱ

    ϝιουΛඋ͑ͨ4QZͷ࡞੒ʹ͸

    ͔ͳΓͷख͕͔͔ؒΔʜ
    ͳΜͱ͔QVTI7JFX$POUSPMMFS͚ͩΛ

    ࠩ͠ସ͑ΒΕͳ͍΋ͷ͔ʜ

    View full-size slide

  68. 4JOHMF.FUIPE4UVC4QZ
    ͦ͜Ͱ

    View full-size slide

  69. ·ͣ͸QVTI7JFX$POUPMMFSʹ

    ૬౰͢Δ1SPUPDPMΛ࡞੒
    ͜ͷ1SPUPDPMͰ࣮૷Λཁٻ͢Δͷ͸

    QVTI7JFX$POUSPMMFS͚ͩʹ͢Δ

    View full-size slide

  70. ࣍ʹઌ΄Ͳͷ1SPUPDPMΛ࣮૷ͯ͠

    ࣮ࡍͷQVTI7JFX$POUSPMMFSΛݺͿ

    ΦϒδΣΫτΛ࡞੒
    1SPUPDPMͷ࣮૷ʹඞཁͳͷ͸

    QVTI7JFX$POUSPMMFS͚ͩ

    ͳͷͰָ͍͢͝

    View full-size slide

  71. Ҿ਺ܦ༝Ͱઌ΄ͲͷΫϥεΛ஫ೖ
    ઌ΄ͲͷΫϥεܦ༝Ͱ

    QVTI7JFX$POUSPMMFS

    ͕ݺͼग़͞ΕΔΑ͏ʹ͢Δ
    ઃܭमਖ਼ޙͷςετର৅

    View full-size slide

  72. ຊମଆͷ४උ׬ྃ
    ͓ΊͰͱ͏͍͟͝·͢

    View full-size slide

  73. ಉ͡1SPUPDPMΛ࣮૷͢Δ4QZΛ࡞੒
    QVTI7JFX$POUSPMMFSͷ

    ݺͼग़͠ཤྺͷه࿥ՕॴΛ༻ҙ
    QVTI7JFX$POUSPMMFS͕ݺ͹ΕͨΒه࿥ʹ௥Ճ

    View full-size slide

  74. ઌ΄Ͳͷ4QZΛҾ਺ܦ༝Ͱ஫ೖ
    4QZܦ༝ͰQVTI7JFX$POUSPMMFS

    ͷݺͼग़͕͠ݕূͰ͖ͨʂ
    ઃܭमਖ਼ޙͷςετ

    View full-size slide

  75. 4JOHMF.FUIPE4UVC4QZ
    w ͲΜͳ࣌ʹ࢖͏͔ɿ
    w ϝιου΍ϑΟʔϧυ͕ଟ͍ΦϒδΣΫτ

    ΁ͷೖग़ྗΛ੍ޚ͍ͨ͠ͱ͖
    w ԿΛ͢Δ͔ɿ
    w ϝιουͭΛ੾Γग़ͯ͠4UVC4QZΛ࡞੒
    w *OQVU0VUQVU0CKFDU*OKFDUJPOͰ஫ೖ

    View full-size slide

  76. ґଘؔ܎Λ੔ཧ͢Δ

    ύλʔϯ
    ύλʔϯ

    View full-size slide

  77. ςετର৅
    0VUQVU*OQVU0CKFDU*OKFDUJPOΛ

    ଓ͚ΔͱɺҾ਺͕૿͑ͯ͘Δ
    એݴҾ਺ॳظԽςετͰɺ

    ͦΕͧΕಉ͡Α͏ͳ͜ͱΛճ΋

    ॻ͘ඞཁ͕͋ͬͯͱͯ΋ͭΒ͍

    View full-size slide

  78. ಛʹ7JFX$POUSPMMFSܥ͸ಉ͡Α͏ͳҾ਺Λ

    Կ౓΋ॻ͘Ӌ໨ʹͳͬͯͭΒ͍

    View full-size slide

  79. ςετΛߟ͑ͯΈΔ
    ·ͣ͸

    View full-size slide

  80. ςετ͸ॻ͚Δ͕ɺςετʹؔ܎ͳ͍Ҿ਺͕ଟ͍ͷͰݟ௨͕͠ѱ͍

    View full-size slide

  81. %FQFOEFODZ#BH
    ͦ͜Ͱ

    View full-size slide

  82. ͢΂ͯͷ7JFX$POUSPMMFSͰڞ௨ͯ͠࢖͏΋ͷΛ#BH΁·ͱΊΔ
    ஫ҙͯ͠ཉ͍͠ͷ͸ɺڞ௨͠ͳ͍΋ͷ͸

    ͜͜ʹೖΕͯ͸͍͚ͳ͍ͱ͍͏͜ͱ

    ʢΠϯλʔϑΣʔε෼཭ݪଇʹҧ൓͢ΔͨΊʣ

    View full-size slide

  83. ςετର৅Λमਖ਼ͯ͠ɺઌ΄Ͳ·ͱΊͨ#BHΛड͚औΔΑ͏ʹ͢Δ

    View full-size slide

  84. ґଘର৅͕૿͑ͯ΋ɺ

    #BHʹ௥Ճ͢Δ͚͍͍ͩ
    ͦͷͨΊɺमਖ਼͢ΔՕॴΛ

    ͭʹݮΒͤΔ

    View full-size slide

  85. ຊମଆͷ४උ׬ྃ
    ͓ΊͰͱ͏͍͟͝·͢

    View full-size slide

  86. ςετଆͰ͸͞Βʹ#BHͷ

    ࡞੒ํ๏Λ؆୯ʹͰ͖·͢

    View full-size slide

  87. ςετ༻ʹ#BHʹࣗ਎Λ࡞੒͢ΔϑΝΫτϦؔ਺Λੜ΍͓ͯ͘͠
    ಛʹࢦఆ͕ͳ͚Ε͹σϑΥϧτҾ਺Ͱ

    ద౰ͳ΋ͷ͕࢖ΘΕΔΑ͏ʹ͓ͯ͘͠

    View full-size slide

  88. ςετଆͰઌ΄ͲͷϑΝΫτϦؔ਺Λ࢖͏Α͏ʹ͢Δ
    ͲΜͳ΋ͷ͕࢖ΘΕͯ΋ςετʹ

    Өڹ͕ͳ͍ͳΒɺҾ਺ΛলུͰ͖Δ

    View full-size slide

  89. %FQFOEFODZ#BH
    w ͲΜͳ࣌ʹ࢖͏͔ɿ
    w ͋ΔΫϥε܈ʹڞ௨ͨ͠Ҿ਺͕ଟ͘ɺ

    ݟ௨͕͠ѱ͘ͳ͍ͬͯΔ৔߹
    w ԿΛ͢Δ͔ɿ
    w ڞ௨ͨ͠Ҿ਺Λ#BHͰͻͱ·ͱΊʹ੔ཧ
    w ςετͰ͸#BHΛϑΝΫτϦؔ਺Ͱ࡞੒ͯ͠ར༻
    w ϑΝΫτϦؔ਺ʹσϑΥϧτҾ਺Λઃఆ͓ͯ͘͠ͱศར

    View full-size slide

  90. ςετର৅Λ෼ׂ͢Δ

    ύλʔϯ
    ύλʔϯ

    View full-size slide

  91. ςετର৅ͷ.PEFM
    ঢ়ଶมԽΛEFMFHBUF

    ͔Β؂ࢹͰ͖Δ
    ͋Δؔ਺Λ࣮ߦ͢Δͱ

    ಺෦ঢ়ଶ͕มԽͯ͠
    EFMFHBUFʹ௨஌͞Εɺ
    ͍ͭͰʹϩά͕औΒΕΔ
    .PEFM͸ঢ়ଶΛ

    อ͍࣋ͯ͠Δ
    ϩάΛ୲౰͢Δ-PHHFS͸

    Ҿ਺ܦ༝Ͱ஫ೖ͞ΕΔ

    View full-size slide

  92. ςετΛߟ͑ͯΈΔ
    ·ͣ͸

    View full-size slide

  93. .PEFMͷঢ়ଶભҠΛ

    ͔֬ΊΔςετʹ

    -PHHFSΛ༩͑Δඞཁ͕
    ͋Δͷ͸ͪΐͬͱҧ࿨ײ
    ରԠ͢Δςετ .PEFMͷঢ়ଶભҠΛݕূ͍ͯ͠Δ

    View full-size slide

  94. ςετ͔ΒઃܭΛ

    ٯࢉ͢Δ
    ͦ͏͍͏ͱ͖͸

    View full-size slide

  95. ͜͏͍͏ͱ͖͸ϩάػೳΛ

    .PEFM͔Β෼཭ͨ͘͠ͳΔ
    ϩά͸.PEFMͷঢ়ଶભҠΛ

    ه࿥͢Δ΋ͷʹͳ͍ͬͯΔ
    ͭ·ΓɺϩάػೳΛ෼཭ͨ͠ͱ

    ͯ͠΋ঢ়ଶભҠΛݕ஌Ͱ͖Ε͹ɺ

    ͜Ε·Ͱ௨ΓʹϩάΛऔΕͦ͏ͳ

    ༧ײ͕͋Δ

    View full-size slide

  96. -PHHJOH0CTFSWFS
    ͦ͜Ͱ

    View full-size slide

  97. -PHHFSΛ৽͘͠

    .PEFMͷ؂ࢹऀʹ

    ௥Ճ͢ΔΘ͚͕ͩɺ

    EFMFHBUFͷ··ͩͱ

    ෳ਺ͷΦϒδΣΫτ͔Β

    ؂ࢹͮ͠Β͍ͷͰɺ

    3Y4XJGU΁ஔ͖׵͑Δ
    .PEFM͔Βϩάͷ

    ੹຿Λ֎͢
    ઃܭमਖ਼ޙͷςετର৅

    View full-size slide

  98. .PEFMΛ؂ࢹͯ͠ϩά
    Λૹ৴͢ΔΫϥεΛ࡞੒
    .PEFMͷঢ়ଶ͕

    มԽͨ͠ΒϩάΛૹ৴
    .PEFMͷঢ়ଶભҠΛ؂ࢹ

    View full-size slide

  99. ຊମଆͷ४උ׬ྃ
    ͓ΊͰͱ͏͍͟͝·͢

    View full-size slide

  100. .PEFMͷ੹຿͔Βϩά
    ͕֎ΕͨͷͰɺςετ͕

    ঢ়ଶભҠͷݕূʹ

    ઐ೦Ͱ͖ΔΑ͏ʹͳͬͨʂ
    ઃܭमਖ਼ޙͷςετ

    View full-size slide

  101. -PHHJOH0CTFSWFS
    w ͲΜͳ࣌ʹ࢖͏͔ɿ
    w .PEFMʹϩάػೳ͕ࠞࡏ͍ͯ͠Δ৔߹
    w ԿΛ͢Δ͔ɿ
    w .PEFMΛෳ਺ͷ0CTFSWFS͔Β؂ࢹͰ͖ΔΑ͏ʹ͢Δ
    w .PEFM͔Βϩάػೳͷ੹຿Λ֎͢
    w .PEFMΛ؂ࢹ͢Δ-PHHFSΛ࡞੒͢Δ

    View full-size slide

  102. ิ଍ɿ3Y4XJGU͕ݏͳਓ޲͚ɺ

    EFMFHBUFͷෳ਺ܥ͸͜͏ͳΔ
    ஍ࠈͷນ։͚

    View full-size slide

  103. EFMFHBUFΛ഑ྻʹ͢Δ
    EFMFHBUFΛ഑ྻʹ͢Δͱɺ

    ऑࢀরʹ͢Δίϯςφܕ͕ඞཁʹͳΔ
    Լͩͱ͙͢ʹճऩ͞ΕͪΌ͏ͷͰޡΓɿ

    weak var delegates: [Delegate]

    View full-size slide

  104. ઌ΄Ͳͷίϯςφܕͷܕύϥϝʔλʹ

    EFMFHBUFͷ1SPUPDPMΛೖΕ͍͕ͨɺ

    4XJGUͷ੍໿Ͱ͜Ε͕Ͱ͖ͳ͍ͷͰ

    ۤ͠ฆΕͷ5ZQF&SBTVSF͕ൃੜ

    View full-size slide

  105. ิ଍ͷ·ͱΊ
    w %FMFHBUFͰ΋ෳ਺ͷΦϒδΣΫτ͔Β؂ࢹͰ͖Δ
    w ͨͩ͠ɺ࣮ݱ͢ΔͨΊͷίʔυྔ͸ଟ͘໘౗
    w ͓ͱͳ͘͠3Y4XJGUʢ͔ͦΕʹ૬౰͢Δ΋ͷʣΛ

    ࢖͍·͠ΐ͏

    View full-size slide

  106. ඇಉظͳςετΛ

    ಉظతʹ͢Δύλʔϯ
    ύλʔϯ

    View full-size slide

  107. ςετର৅
    ʢ࣮ࡍͷ௨৴ͩͱίʔυ௕͍ͷͰ୅༻ʣ
    ॏෳऔಘΛ๷͙

    ϑϥά͕͋Δ
    ੒ޭΠϕϯτ͕ྲྀΕΔ
    ࣦഊΠϕϯτ͕ྲྀΕΔ
    औಘʹ੒ޭͨ͠Β௨஌
    औಘΛ։࢝͢Δؔ਺
    จࣈྻΛαʔόʔ͔Βऔಘ͢Δ.PEFM

    View full-size slide

  108. ςετΛߟ͑ͯΈΔ
    ·ͣ͸

    View full-size slide

  109. ରԠ͢Δςετ
    αʔόʔͱͷ௨৴ޙͷঢ়ଶΛςετ͍͕ͨ͠ɺαʔόʔͱͷ

    ௨৴͸ඇಉظͳͷͰɺඇಉظͳςετʹ͠ͳ͍ͱ͍͚ͳ͍
    ͔͠͠ɺඇಉظͳςετ͸ίʔυྔ͕ଟ͘ͳΔͷͰɺ

    ؾ͕ਐ·ͳ͍ʜ

    View full-size slide

  110. 3Y&WFOU#MPDLFS
    ͦ͜Ͱ

    View full-size slide

  111. Πϕϯτͷಉظతͳ

    ଴ͪ߹ΘͤͷͨΊʹ
    3Y#MPDLJOHΛ࢖͍·͢
    ࠷ॳͷ݁Ռ͕OJMͳͷͰ

    ͦΕΛআ֎
    OJMͰͳ͍݁Ռ͕དྷΔ·Ͱ

    $PNQMFUFΛ଴ͭ
    $PNQMFUFʹͳΔ·Ͱ

    ίʔυͷ࣮ߦΛࢭΊΔ
    ݁Ռ͕͖ͨΒऔΓग़͢
    ಉظతʹॻ͚ͨʂ
    मਖ਼ޙͷςετ

    View full-size slide

  112. ଴ͪ߹Θͤ͢Δίʔυ͸ͪ͝Όͪ͝Ό͢ΔͷͰɺ

    ؔ਺ʹ͘͘Γग़͢ͱՄಡੑͱ࠶ར༻ੑ্͕͕Δ

    View full-size slide

  113. 3Y&WFOU#MPDLFS
    w ͲΜͳ࣌ʹ࢖͏͔ɿ
    w 3YͰදݱ͞ΕͨΠϕϯτ͕ඇಉظͰ

    ςετΛॻ͖ͮΒ͍ͱ͖
    w ԿΛ͢Δ͔ɿ
    w 3Y#MPDLJOHΛ͔ͭͬͯಉظతͳίʔυʹ͢Δ
    w ଴ͪ߹Θͤͷίʔυ͸ؔ਺ʹ·ͱΊΔͱΑ͍

    View full-size slide

  114. ಺෦ঢ়ଶΛ੍ޚ͢Δ

    ύλʔϯ
    ύλʔϯ

    View full-size slide

  115. ςετର৅͸ઌ΄Ͳͱ

    ಉ͡.PEFMΛ࢖͍·͢

    View full-size slide

  116. ςετର৅
    ʢ࣮ࡍͷ௨৴ͩͱίʔυ௕͍ͷͰ୅༻ʣ
    ॏෳऔಘΛ๷͙

    ϑϥά͕͋Δ
    ੒ޭΠϕϯτ͕ྲྀΕΔ
    ࣦഊΠϕϯτ͕ྲྀΕΔ
    औಘʹ੒ޭͨ͠Β௨஌
    औಘΛ։࢝͢Δؔ਺
    จࣈྻΛαʔόʔ͔Βऔಘ͢Δ.PEFM

    View full-size slide

  117. ςετΛߟ͑ͯΈΔ
    ΋͏Ұ౓

    View full-size slide

  118. ͜ͷ.PEFMͷ͢΂ͯͷঢ়ଶΛ

    ςετ͢Δ͜ͱʹͨ͠ͱ͠·͢
    ͜ͷ.PEFMͷͱΓ͑Δঢ়ଶͬͯɺ

    ͍͍ͬͨͲΕ͘Β͍͋ΔΜͰ͠ΐ͏ʁ

    View full-size slide

  119. SFTVMU%JE$IBOHFͷ

    ࠷ޙͷ஋
    FSSPS%JE$IBOHFͷ

    ࠷ޙͷ஋
    JT'FUDIJOH
    OJM OJM USVF
    SFTVMU OJM USVF
    OJM FSSPS USVF
    SFTVMU FSSPS USVF
    OJM OJM GBMTF
    SFTVMU OJM GBMTF
    OJM FSSPS GBMTF
    OJM FSSPS GBMTF
    ͋ɺ͋Εʁ͜Μͳʹ͋ΔΜ͚ͩͬʜʁ

    View full-size slide

  120. ͋Γ͑ͳ͍ঢ়ଶ΋

    ؚ·Ε͍ͯΔؾ͕͢Δʜ
    ʢঢ়ଶͷݟ௨͕͠ѱ͍ͷͰ֬৴Λ΋ͯͳ͍ʣ

    View full-size slide

  121. ςετ͔ΒઃܭΛ

    ٯࢉ͢Δ
    ͦ͏͍͏ͱ͖͸

    View full-size slide

  122. ঢ়ଶͷҰཡΛఆٛͯ͠ɺ

    Ұݩ؅ཧ͢Ε͹ݟ௨͕͠Αͦ͞͏

    View full-size slide

  123. 4UBUF.BDIJOF.PEFM
    ͦ͜Ͱ

    View full-size slide

  124. ·ͣ.PEFMͷऔΓ͏Δঢ়ଶͷҰཡΛ࡞Δ

    View full-size slide

  125. ୯ҰͷϑΟʔϧυͰ

    ঢ়ଶΛҰݩ؅ཧ͢Δ
    ஋͕มΘͬͨΒ

    ௨஌Λͯ͘͠ΕΔ

    3Y4XJGU7BSJBCMF

    Λ࢖͏ͱ୹͘ॻ͚Δ
    7BSJBCMFͷมԽ͸

    ϑΟʔϧυΛ௨ͯ͠

    ֎෦͔Β؂ࢹͰ͖Δ
    ঢ়ଶ͕Ұݩ؅ཧ

    ͞Εͨ͜ͱͰ

    ঢ়ଶભҠͷ༷ࢠ͕

    Α͘Θ͔Δ
    ઃܭमਖ਼ޙͷຊମίʔυ

    View full-size slide

  126. ຊମଆͷ४උ׬ྃ
    ͓ΊͰͱ͏͍͟͝·͢

    View full-size slide

  127. ঢ়ଶͷҰཡ͕͋ͬͯɺ͞Βʹ

    ঢ়ଶ͕Ұݩ؅ཧ͞Ε͍ͯΕ͹

    ؆୯ʹঢ়ଶભҠਤ͕ॻ͚Δ

    View full-size slide

  128. .PEFMͷऔΓ͏Δঢ়ଶͷҰཡ͸͜Ε

    View full-size slide

  129. .fetching
    .fetched(String) .failed(Error)
    .notFetchedYet
    GFUDI

    GFUDI
    GFUDI

    GFUDI

    View full-size slide

  130. ঢ়ଶભҠਤΛݟΔͱ

    ໼ҹͷ਺͸શ෦Ͱͭ
    ͦΕͧΕͭͣͭςετ͢Ε͹

    શͯͷঢ়ଶભҠΛݕূͨ͜͠ͱʹͳΔ

    View full-size slide

  131. 4UBUF.BDIJOF.PEFM
    w ͲΜͳ࣌ʹ࢖͏͔ɿ
    w .PEFMͷͱΓ͏Δঢ়ଶͷݟ௨͕͠ѱ͍ͱ͖
    w ԿΛ͢Δ͔ɿ
    w FOVNͰঢ়ଶͷҰཡΛ࡞੒
    w ୯ҰͷϑΟʔϧυͰঢ়ଶΛ؅ཧ͢Δ
    w 3Y4XJGU7BSJBCMFΛ࢖͏ͱ୹͘ॻ͚Δ

    View full-size slide

  132. ܕݕࠪͰςετΛ

    ݮΒ͢ύλʔϯ
    ύλʔϯ

    View full-size slide

  133. ςετର৅
    EFRVFVF3FVTBCMF$FMM͸ɺ

    SFHJTUFS๨ΕͯΔͱΫϥογϡ͢Δ

    View full-size slide

  134. ςετΛߟ͑ͯΈΔ
    ·ͣ͸

    View full-size slide

  135. Ϋϥογϡ͠ͳ͍͜ͱ

    ͙Β͍͸֬ೝ͍͕ͨ͠ʜ
    ͍͍ͪͪςετ͢Δͷ΋ʜ

    View full-size slide

  136. ςετ͠ͳͯ͘΋

    ͍͍ํ๏Λߟ͑Δ
    ͦ͏͍͏ͱ͖͸

    View full-size slide

  137. SFHJTUFSͨ͠ূڌΛ

    EFRVFVFؔ਺͕

    ཁٻ͢ΔΑ͏ʹ͢Ε͹

    Αͦ͞͏ͳ༧ײ͕͋Δ

    View full-size slide

  138. 1SFQSPDFTTPS5PLFO
    ͦ͏͍͏ͱ͖͸

    View full-size slide

  139. UPLFO͸֎͔Β

    ࡞Εͳ͍Α͏ʹ

    pMFQSJWBUFͰ੍ݶ
    ઃܭमਖ਼ޙͷςετର৅ʢ$FMMଆʣ
    SFHJTUFS͢Δͱূڌͱͯ͠

    UPLFOΛಘΒΕΔΑ͏ʹ͢Δ
    SFHJTUFSͷϥούʔ

    ؔ਺Λ࡞੒͢Δ

    View full-size slide

  140. EFRVFVFؔ਺ͷҾ਺ͰɺSFHJTUFSͨ͠

    ূڌͷUPLFOΛཁٻ͢ΔΑ͏ʹ͢Δ
    UPLFO͸֎͔Β࡞Εͳ͍ͷͰɺઌʹSFHJTUFS

    ͯ͠UPLFOΛಘ͓͔ͯͳ͍ͱϏϧυ͕௨Βͳ͍
    SFHJTUFSͯ͋͠Ε͹OJMʹͳΒͳ͍ͱ

    ެࣜυΩϡϝϯτʹॻ͍ͯ͋ΔͷͰ

    ҆৺ͯ͠GPSDFVOXSBQͰ͖Δʂ

    View full-size slide

  141. 1SFQSPDFTTPS5PLFO
    w ͲΜͳ࣌ʹ࢖͏͔ɿ
    w ͋Δॲཧͷલʹඞཁͳલॲཧ͕͋Δͱ͖
    w ԿΛ͢Δ͔ɿ
    w લॲཧΛ࣮ߦ͠ͳ͍ͱಘΒΕͳ͍5PLFOΛ࡞੒
    w લॲཧ͕ඞཁͳؔ਺Ͱ5PLFOΛཁٻͤ͞Δ

    View full-size slide

  142. ·ͱΊ
    w ཧ૝ڷ͸େྔͷ୯ମςετͷதʹ

    ͋Γ·͢
    w ୯ମςετ͕؆୯ʹͳΔͭͷ

    σβΠϯύλʔϯΛ঺հ͠·ͨ͠
    w ίʔυΛॻ͘ͱ͖͸ςετ͕

    Ͳ͏ͳΔ͔Λҙࣝ͠·͠ΐ͏

    View full-size slide

  143. એ఻
    w ൃදऀͷۈΊΔNJYJ(3061Ͱ͸

    J04ΤϯδχΞΛืू͍ͯ͠·͢ʂ
    w ͝ڵຯ͋Δํ͸!PSHB@DIFN·Ͱ

    %JSFDU.FTTBHFΛ͓ئ͍͠·͢ʂ

    View full-size slide