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

Deep dive into Protocols

Deep dive into Protocols

Ritesh Gupta

July 05, 2017
Tweet

More Decks by Ritesh Gupta

Other Decks in Programming

Transcript

  1. deep dive
    into Protocols
    (Swift Delhi Meetup, Chapter 3)
    ~ Ritesh Gupta

    View full-size slide

  2. `Protocol-Oriented Programming
    in Swift`
    https://developer.apple.com/videos/play/wwdc2015/408/

    WWDC - 2015

    View full-size slide

  3. `Protocol and Value Oriented
    Programming in UIKit Apps`
    https://developer.apple.com/videos/play/wwdc2016/419/

    WWDC - 2016

    View full-size slide

  4. playground demos..

    View full-size slide

  5. protocol ->
    protocol extension ->

    View full-size slide

  6. protocol ->
    protocol extension ->
    protocol 

    constrained
    extension

    ->

    View full-size slide

  7. self
    (refers to the `object`)
    vs
    Self

    (refers to the `type` that
    conforms to a protocol)

    View full-size slide

  8. https://krakendev.io/blog/generic-protocols-and-their-
    shortcomings

    http://austinzheng.com/2015/09/29/swift-generics-pt-2/

    http://www.russbishop.net/swift-associated-types

    View full-size slide

  9. protocol
    is not a
    silver bullet..
    http://chris.eidhof.nl/post/protocol-oriented-programming/

    View full-size slide