$30 off During Our Annual Pro Sale. View Details »

Thirteen Ways of Looking at a View Controller

Thirteen Ways of Looking at a View Controller

View controllers: we know them, love them, despise them, and overload them.

Greg Heo

June 06, 2017
Tweet

More Decks by Greg Heo

Other Decks in Technology

Transcript

  1. @gregheo AltConf 2017
    I was of three minds,
    Like a tree
    In which there are three blackbirds.
    Thirteen Ways of Looking at a Blackbird

    Wallace Stevens

    View Slide

  2. @gregheo AltConf 2017
    Thirteen Ways
    of Looking at a
    View Controller
    approximately

    View Slide

  3. @gregheo AltConf 2017
    Hold the Model
    Controller
    Model View

    View Slide

  4. @gregheo AltConf 2017
    Coordinate Between Views
    Button Label
    tap

    action
    set

    text
    View Controller ???

    View Slide

  5. @gregheo AltConf 2017
    View Appearance Callbacks
    • view did load
    • view will / did appear
    • view will / did disappear

    View Slide

  6. @gregheo AltConf 2017
    Handle View Layout
    • loadView
    • view setup in viewDidLoad
    • view will / did layout subviews
    • layout guides

    View Slide

  7. @gregheo AltConf 2017
    “We shape our buildings, 

    and afterwards our

    buildings shape us.”

    View Slide

  8. @gregheo AltConf 2017
    Miscellaneous
    • “is editing” state
    • state restoration
    • search display controller
    • title

    View Slide

  9. @gregheo AltConf 2017
    Manage Style
    • presentation style
    • transitions
    • thirteen ways to handle rotation

    View Slide

  10. @gregheo AltConf 2017
    Navigation
    • Navigation controllers, tab bar controllers,

    split view controllers
    • View controller containment
    • Storyboard segues

    View Slide

  11. @gregheo AltConf 2017
    Among twenty snowy mountains,
    The only moving thing
    Was the eye of the blackbird.
    swift

    View Slide

  12. @gregheo AltConf 2017
    " #

    View Slide

  13. @gregheo AltConf 2017
    so controlling
    such view
    much single

    responsibility
    wow
    very SOLID

    View Slide

  14. @gregheo AltConf 2017
    Model View
    Presentation
    Logic
    Navigation
    Business

    Logic
    Manage
    Views
    Massive View Controller
    View Controller

    View Slide

  15. @gregheo AltConf 2017
    View Controller
    Model
    View
    Presentation
    Logic
    Navigation?
    Business

    Logic
    Manage
    Views
    MVVM
    View Model

    View Slide

  16. @gregheo AltConf 2017
    Routing
    Entity
    View Presentation
    Logic
    Navigation
    Business

    Logic
    Models
    VIPER
    Presenter
    Interactor

    View Slide

  17. @gregheo AltConf 2017
    Router View
    Presentation
    Logic
    Navigation Business

    Logic
    Model
    Riblets
    Presenter
    Interactor

    View Slide

  18. @gregheo AltConf 2017
    Streams
    View Model
    Reactive
    Observer
    Business

    Logic
    View Model
    Business

    Logic

    View Slide

  19. @gregheo AltConf 2017
    When the blackbird flew out of sight,
    It marked the edge
    Of one of many circles.

    View Slide

  20. @gregheo AltConf 2017

    View Slide

  21. @gregheo AltConf 2017

    View Slide

  22. @gregheo AltConf 2017
    Thirteen Ways
    of Looking at a
    View Controller

    View Slide