Snips MVC revisited by Michael Fester

  • View
    4.546

  • Download
    0

  • Category

    Software

Preview:

Citation preview

Michael Fester @michaelfester

:snips

MVC revisited

BAR

BANK WAITING TIME: 15 MIN

FOOD COURT RATING: 4/5

WAITING TIME: 2 MIN

METRO STATION LINE: 1, TRAFFIC: FLUID

NEXT PEAK: 17:45

TUESDAY, 14:25 CLOUDY, RAIN: 15%TEMPERATURE: 18°C

NATIONAL HOLIDAYCAR TRAFFIC FLUID, NO DANGER

CONSTRUCTION SITE NOISY, FREQUENT TRUCK STOPS

POLICE STATIONBUS STOP

LINES: 45, 72, 96, 108NEXT ARRIVAL: 4 MIN

Going to work Before a meeting At lunch At a club

Model-View-Controller (MVC)

Model-View-ViewModel (MVVM)

Tasks of the ViewModel

» Network logic » Updating models » Maintaining UI state » Formatting (numbers, strings, dates) » Responding to user input

View models are testable View models are serialisable View models are portable

HomeViewModel

HomeViewController

Loading state

Form validation

Unit testing signals

ViewController revisited

» Layout » Animation » Transition » Rotation

ViewModel

» Network logic » Updating models » Maintaining UI state » Formatting (numbers, strings, dates) » Responding to user input

Data binding in ReactiveCocoa

» Consistency » Explicit » Functional » Stateless

Come build delightful apps with us

www.snips.net

@snips

Recommended