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

MVVM-C In Practice

MVVM-C In Practice

Model View View Model has been around as an architecture pattern for quite a while now and is generally accepted as an improvement over plain MVC. However MVVM still does not solve the problem of who takes responsibility for navigation hence the C, Coordinators. The session will look at developing an MVVM-C based app with Swift and Protocols using a mix of example along with hints and tips all gained from using MVVM-C in a recent OS X and iOS application where much of the code was shared.

macdevnet

May 23, 2016
Tweet

Other Decks in Technology

Transcript

  1. • Code Sharing Between iOS and OSX apps • Good

    Test Coverage • Easy To Test • Flexible Goals
  2. Model ? View Model ? View UIView Controller UIViewController Business

    Logic Data C.R.U.D Coordinator Navigation / Flow Presentation User Input
  3. • Get Data From a Model • Send Data To

    a Model • Provide a Data Interface For Views • Inform View of Data Changes • Business Logic • Communicate State to Coordinator View Model View Models
  4. • Handle Data Access • Handle Saving Data • Uses

    functions not properties • All functions return data in a completion handler • Always assume to be asynchronous Model Models
  5. Model ? View Model ? View UIView Controller UIViewController Business

    Logic Data C.R.U.D Coordinator Navigation / Flow Presentation User Input