Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
MVVM & RAC
Search
Ullrich Schäfer
April 16, 2014
Programming
1
240
MVVM & RAC
Talk given at CocoaHeads Berlin April 2014
Demo project:
https://github.com/stigi/mvvm-example
Ullrich Schäfer
April 16, 2014
Tweet
Share
Other Decks in Programming
See All in Programming
使ってみよう Azure AI Document Intelligence
kosmosebi
2
300
コーンフレークから始める モデリング会話入門
ogurotakayuki
0
360
Komplexe Oberflächen mit SVG und der Web Animation API
joergneumann
0
670
AWS CDKコントリビュートTIPS / aws-cdk-contribution-tips
gotok365
2
120
Ruby Function Composition
bkuhlmann
1
330
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
170
ONE WEDGE_company_guide
1wedge_one
0
470
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
180
Site Reliability Engineering for GMO
pyama86
8
1k
0→1と1→10の狭間で Javaという技術選定を振り返る/Reflecting on the Decision to Choose Java Between Scaling from 0 to 1 and 1 to 10
jaguar_imo
2
380
Hanami and htmx
bkuhlmann
0
210
SwiftUIで使いやすいToastの作り方 / How to build a Toast system which is easy to use in SwiftUI
lovee
3
140
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
325
20k
Designing Experiences People Love
moore
136
23k
Clear Off the Table
cherdarchuk
84
310k
The Invisible Customer
myddelton
114
12k
A Modern Web Designer's Workflow
chriscoyier
689
190k
A designer walks into a library…
pauljervisheath
200
23k
Making the Leap to Tech Lead
cromwellryan
124
8.5k
How STYLIGHT went responsive
nonsquared
92
4.8k
Product Roadmaps are Hard
iamctodd
44
9.7k
The Mythical Team-Month
searls
216
42k
Principles of Awesome APIs and How to Build Them.
keavy
121
16k
Optimising Largest Contentful Paint
csswizardry
8
2.4k
Transcript
MVVM & RAC CocoaHeads BLN 2014/04
About Me! ! ! stigi " stigi # ullrich.is ||
nslog.de || .com $ ullrich@ .com
Model – View – ViewModel • But first…
Where we come from – MVC Controller Model View Notify
Update Update User Action (according to Apple)
Reality • View controllers carry application logic! • And view
controllers are part of the View! • shouldRotate, viewDidAppear, viewDidLayoutSubviews! • Views often know way to much about the model! • -[UITableViewCell configureWithObject:]! • -[PersonView initWithPerson:]
Model – View – ViewModel Model View | ViewController ViewModel
Update Notify User Actions Notify
Benefits • ViewController holds no application logic! • ViewModel does
not know views! • ViewModel can be reused and extended! • Easy UI changes! • ViewModel is testable! • Easy migration, can co-exist with M–V–C
What goes where Model View | ViewController ViewModel UIView, Nibs,!
UIViewController,! DataSources ViewModel NSManagedObject,! API Controller,! … RAC RAC
Reactive Cocoa • FRP! • React to Change! • Declarative!
• Works great with KVO
Examples • In Xcode! ! ! ! • https://github.com/stigi/mvvm-example
Take aways • You’re doing it wrong! • MVVM is
Zen, give it a try! • MVVM & MVC can co-exists
Questions? • Yes, Please?
About Me! ! ! stigi " stigi # ullrich.is ||
nslog.de || .com $ ullrich@ .com