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

Thinking in Swift!

Thinking in Swift!

Swift India, Delhi Meetup

Ritesh Gupta

January 21, 2017
Tweet

More Decks by Ritesh Gupta

Other Decks in Technology

Transcript

  1. in Swift
    ~ Ritesh Gupta
    (Swift India, Delhi Meetup)

    View full-size slide

  2. Swift
    is just not
    a syntax migration
    from Objective-C…

    View full-size slide

  3. Swift
    is not objective-c
    styled language…

    View full-size slide

  4. C ~> C++
    Objective-C ~> Swift
    { imperative } { object oriented }
    { object oriented } { protocol oriented }

    View full-size slide

  5. stuck with
    Inheritance..

    View full-size slide

  6. compose
    everything with
    Protocols..

    View full-size slide

  7. UIButton
    UIBarButtonItem

    View full-size slide

  8. UIButton
    UIControl
    UIView

    View full-size slide

  9. UIBarButtonItem
    UIBarItem
    NSObject

    View full-size slide

  10. UIBarButtonItem
    UIBarItem
    NSObject
    UIButton
    UIControl
    UIView

    View full-size slide

  11. Entity
    (class, struct)
    vs
    Behaviour
    (protocol)

    View full-size slide

  12. UIView
    Framable

    View full-size slide

  13. UIImageView
    ImageRenderable,
    Framable

    View full-size slide

  14. UIButton
    Tappable,
    ImageRenderable,
    Framable

    View full-size slide

  15. UITableViewCell

    UICollectionViewCell
    Reusable,
    Framable

    View full-size slide

  16. UIScrollView
    Scrollable,
    Framable

    View full-size slide

  17. UITableView

    UICollectionView
    Listable,
    Scrollable,
    Framable

    View full-size slide

  18. UI Entities
    is collection of
    behaviours…

    View full-size slide

  19. ..computed variables,
    extensions, values types,
    immutability, functional
    programming, generics,
    enums, associative types/
    values..

    View full-size slide

  20. thinking in
    protocol..

    View full-size slide