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

Dependency Injection in Swift2

Dependency Injection in Swift2

2016/02/09 - kyobashi.swift #1@リクルートマーケティングパートナーズ
https://kyobashi-swift.connpass.com/event/23712/

gomi_ningen

February 09, 2016
Tweet

More Decks by gomi_ningen

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ ઃఆɿ๭ϥϏοτϋ΢εࣾͰಇࣾ͘ச೥ੜ  ɾ+BWBόοΫΤϯυγεςϜอकɾػೳ։ൃ ɾJ04ʢ4XJGUʣΞϓϦ৽ن։ൃ ɾ4DBMB +BWBͰద౰ʹπʔϧΛ࡞ͬͨΓͳͲ  ɾ޷͖ͳݴޠ͸+BWB 4DBMBʢ4DBMBॻ͖͍ͨʣ

    ɾ޷͖ͳ࡞඼͸͝஫จ͸͏͗͞Ͱ͔͢  ɾJ04ʢ4XJGUʣ։ൃܦݧ൒೥͔͠΍͍ͬͯͳ͍ऑฌɾૉਓ   🐰͕࣌ؒͳ͍ͷͰࣗݾ঺հ͸ׂѪ͠·͢🐰 !HPNJ@OJOHFO
  2. $MJFOU͕4FSWJDFΛར༻࣮ͯ͠૷͞ΕΔ৔߹Λ૝ఆ͠Α͏         

    ⚡$MJFOU͕ґଘ͢Δ4FSWJDFΛࠩ͠ସ͑ΔͨΊʹ͸ $MJFOUʹมߋΛೖΕΔඞཁ͕͋Δ %FQFOEFODZ*OKFDUJPOͱ͸ʁ ࣮૷࣌ʹґଘΦϒδΣΫτΛબ୒
  3. ίϯςφΛ༻͍ͨ%* ҎԼͷΑ͏ͳؔ܎ͷΦϒδΣΫτ͕͋Δͱ͢Δ        

      "#$ͷΠϯελϯεΛಘΔʹ͸ɺ"# "ͷΠϯελϯε͕ඞཁͰ͋Δ
  4. ίϯςφΛ༻͍ͨ%* 4XJOKFDUͷ$POUBJOFSΛ༻͍ͨґଘΦϒδΣΫτղܾ        

     ɾొ࿥ࡁΈΦϒδΣΫτͷΠϯελϯε͸औಘͰ͖Δ ɾͦ͏Ͱͳ͍΋ͷ͸ɺOJM͕ฦͬͯ͘Δ
  5. %FQFOEFODZ*OKFDUJPOJO4XJGU 4XJOKFDUΛ༻͍ͨಈత%*  •  ಈత%*͸ɺΑ͏΍͘࢖͑ͦ͏ͳίϯςφ͕ੜ·Ε͖ͯͨ •  (PPHMF(VJDFͷΑ͏ͳ΋ͷͱ͸ɺ·ͩ΄Ͳԕ͍ɺ࣮ݱ΋೉ͦ͠͏ •  ݱ࣮తʹߟ͑Δͱͨ͠Βͪ͜ΒΛ࠾༻͢Δ͜ͱʹͳΔ͔ʁ 

    $BLF1BUUFSOͬΆ͍΋ͷΛ༻͍ͨ੩త%*  •  QSPUPDPMFYUFOTJPOʹΑΓ੩త%*͕ߦ͑Δ •  ͔͠͠ɺ೉ղͳ$BLF1BUUFSO͕༨ܭෳࡶʹͳͬͨ΋ͷ •  ༨ܭͳϥΠϒϥϦʹґଘ͠ͳ͍ɺ࣮૷Ϋϥε͕࿐ग़͠ͳ͍఺͸ྑ͍
  6. ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ ࠙਌ձͰ͜Μͳ͓࿩͕͍ͨ͠  •  7JFX$POUSPMMFSΛΧΦεʹ͠ͳ͍ͨΊͷऔΓ૊Έ  •  ϓϨθϯςʔγϣϯ૚ͷঢ়ଶ؅ཧ  • 

    ΑΓ҆શͳΫϥΠΞϯτίʔυ͕ॻ͚ΔΑ͏ͳϞσϧઃܭ  •  Ϗϧυ଎౓վળͷͨΊͷऔΓ૊Έʢ$BSUIBHFUBSHFU෼ׂͳͲʣ  Կ͔͠Βྑ͍ղܾࡦΛ͍࣋ͬͯΔํɺ͓࿩Λ͓ฉ͔͍ͤͯͩ͘͞