MVVM - THe better alternative
WHO?
Kittinun Vantasin
Mobile Tech Lead @ Taskworld
kittinunf
WHat?
WHat (for real)
MVVM
Model - View - ViewModel
App Architecture Pattern
HOW?
(according to )
CONTROLLER
VIEW
MODEL
Model View Controller
HOw? - MVC
James Dempsey and the Breakpoints
http://jamesdempsey.net/model-view-controller/
HOw? - MVC
MODEL
DATA is STOREd and represented
HOw? - MVC
DATA is represented AND
InteractED with
VIEW
HOw? - MVC
A controller object acts as an intermediary between one or more of an application’s view objects and one or more of its model objects. Controller objects are thus a conduit through which view objects learn about changes in model objects and vice versa.
CONTROLLER
HOW?
(according to )
CONTROLLER
VIEW
MODEL
MASSIVE View Controller
HOW?
(according to US & MIcrosoft)
VIEW
MODEL
VIEW
MODEL
Model View VIEWMODEL
Meh
View ---> VIEW MODEL
HOW?
(according to US)
VIEW
MODEL
VIEW
MODEL
UPDATES - DELEGATES / KVO / BINDING
Model View VIEWMODEL
HOW? - VIEW MODEL
(according to US)
VIEW
MODEL
NETWORK REQUESTs by UI needs
SHOWING / HIDING CONTENTs
FORMATTING REPRESENTATION
RESPONDS USER INTENTION
Why?
Promote COde ReUSE
MANAGeable CONTROLLER CODE
TESTable VIEW MODEL
SEparation of Unit
Why?
DEMO - Notes
VIEW (VC)
NoteListVIewController
NoteListVIewMOdel
VIEW MODEL
DEMO - Notes
NoteList VIewMOdel
VIEW MODEL
NoteDETIAL VIewMOdel
VIEW MODEL
DEMO - Notes
NoteDetail VIewcontroller
NoteDETIAL VIewMOdel
VIEW (VC)
VIEW MODEL
updates??
Side notes
works best with Binding mechanism
Reactivecocoa
RxSwift
BOND
Interstellar
REACtive cocoa
RXSWIFT
Q & A
ONE more thing ...
We are as always hiring
http://www.taskworld.com/careers
http://coders.taskworld.com/
MVVM - The better alternative
By Kittinun Vantasin
MVVM - The better alternative
iOS Dev TH #1
- 1,388