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

ドリルドライバーで理解するデリゲートパターン

jollyjoester
November 27, 2016

 ドリルドライバーで理解するデリゲートパターン

Swiftビギナーズ勉強会(2016/11/27)

jollyjoester

November 27, 2016
Tweet

More Decks by jollyjoester

Other Decks in Technology

Transcript

  1. Delegation Delegation is a simple and powerful pattern in which

    one object in a program acts on behalf of, or in coordination with, another object. The delegating object keeps a reference to the other object—the delegate—and at the appropriate time sends a message to it. The message informs the delegate of an event that the delegating object is about to handle or has just handled. The delegate may respond to the message by updating the appearance or state of itself or other objects in the application, and in some cases it can return a value that affects how an impending event is handled. The main value of delegation is that it allows you to easily customize the behavior of several objects in one central object. https://developer.apple.com/library/content/documentation/General/Conceptual/DevPedia-CocoaCore/ Delegation.html#//apple_ref/doc/uid/TP40008195-CH14-SW1
  2. Delegation Delegation is a simple and powerful pattern in which

    one object in a program acts on behalf of, or in coordination with, another object. The delegating object keeps a reference to the other object—the delegate—and at the appropriate time sends a message to it. The message informs the delegate of an event that the delegating object is about to handle or has just handled. The delegate may respond to the message by updating the appearance or state of itself or other objects in the application, and in some cases it can return a value that affects how an impending event is handled. The main value of delegation is that it allows you to easily customize the behavior of several objects in one central object. https://developer.apple.com/library/content/documentation/General/Conceptual/DevPedia-CocoaCore/ Delegation.html#//apple_ref/doc/uid/TP40008195-CH14-SW1
  3. Delegation Delegation is a simple and powerful pattern in which

    one object in a program acts on behalf of, or in coordination with, another object. The delegating object keeps a reference to the other object—the delegate—and at the appropriate time sends a message to it. The message informs the delegate of an event that the delegating object is about to handle or has just handled… https://developer.apple.com/library/content/documentation/General/Conceptual/DevPedia-CocoaCore/ Delegation.html#//apple_ref/doc/uid/TP40008195-CH14-SW1 ҕৡ͸͋ΔΦϒδΣΫτ͕ผͷΦϒδΣΫτͷ୅ΘΓʹಈ࡞ͨ͠ Γௐ੔ͨ͠Γ͢ΔͨΊͷγϯϓϧͰύϫϑϧͳύλʔϯͰ͢ɻ
  4. Delegation … a program acts on behalf of, or in

    coordination with, another object. The delegating object keeps a reference to the other object—the delegate—and at the appropriate time sends a message to it. The message informs the delegate of an event that the delegating object is about to handle or has just handled. The delegate may respond to the message … https://developer.apple.com/library/content/documentation/General/Conceptual/DevPedia-CocoaCore/ Delegation.html#//apple_ref/doc/uid/TP40008195-CH14-SW1 ҕৡ͢ΔΦϒδΣΫτ͸ҕৡ͞ΕΔΦϒδΣΫτͷࢀরΛ อ࣋͠ɺద੾ͳλΠϛϯάͰϝοηʔδΛૹΓ·͢ɻ
  5. Delegation … The delegate may respond to the message by

    updating the appearance or state of itself or other objects in the application, and in some cases it can return a value that affects how an impending event is handled. The main value of delegation is that it allows you to easily customize the behavior of several objects in one central object. https://developer.apple.com/library/content/documentation/General/Conceptual/DevPedia-CocoaCore/ Delegation.html#//apple_ref/doc/uid/TP40008195-CH14-SW1 ҕৡͷओཁͳΦϒδΣΫτͷதͷෳ਺ͷΦϒδΣΫτͷৼ Δ෣͍Λ؆୯ʹΧελϚΠζͰ͖Δ͜ͱͰ͢ɻ
  6. Delegation … The delegate may respond to the message by

    updating the appearance or state of itself or other objects in the application, and in some cases it can return a value that affects how an impending event is handled. The main value of delegation is that it allows you to easily customize the behavior of several objects in one central object. https://developer.apple.com/library/content/documentation/General/Conceptual/DevPedia-CocoaCore/ Delegation.html#//apple_ref/doc/uid/TP40008195-CH14-SW1 ҕৡͷओཁͳΦϒδΣΫτͷதͷෳ਺ͷΦϒδΣΫτͷৼ Δ෣͍Λ؆୯ʹΧελϚΠζͰ͖Δ͜ͱͰ͢ɻ
  7. SwiftѪ޷ձ • Swift޷͖͕ू·ͬͯΘ͍Θ͍ʰָ͠Ήձʱ • Ϩϕϧɺܦݧ౳ෆ໰ ‣ Swift͕޷͖ͳਓʂ ‣ SwiftΛ޷͖ʹͳΔ༧ఆͷਓ ‣

    Ή͠ΖSwift͔Β޷͔Ε͍ͯΔਓ • ݄̍։࠵໨ඪ ‣ ฏ೔ɿஊٛ ‣ ٳ೔ɿ଱ٱ΋͘΋͘ձʴஊٛ