Top Banner
Quiz 1
14

Reactive Cocoa && MVVM

Aug 14, 2015

Download

Mobile

Hai Feng Kao
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Reactive Cocoa && MVVM

Quiz 1

Page 2: Reactive Cocoa && MVVM

Quiz 2

What is the homework?

Page 3: Reactive Cocoa && MVVM

Homework

Page 4: Reactive Cocoa && MVVM

ReactiveCocoa && MVVMHai Feng Kao

Page 5: Reactive Cocoa && MVVM

MVC (Model View Controller)

ModelView Controller

Input

Update

Update

Notify

Page 6: Reactive Cocoa && MVVM

禪師 -鈴木俊隆

Page 7: Reactive Cocoa && MVVM

MVC (Model View Controller)

Model

View ControllerInput

Update

Notify Update

View Selection

Page 8: Reactive Cocoa && MVVM

MVC (Model View Controller)

• Pros : • Independent module• Reusable model

• Cons:• too may files• hard to write unit test• controller need to access view&model

Page 9: Reactive Cocoa && MVVM

MVVM(Model View ViewModel)

ModelView ViewModel

Input Update

Page 10: Reactive Cocoa && MVVM

MVVM(Model View ViewModel)

• Pros:• ViewModel can be unit tested

• ViewModel has no access to view• Model has no access to ViewModel

• View is simple• UI logic moved to ViewModel

• Cons:• hard to debug• performance hit!!!

Page 11: Reactive Cocoa && MVVM

MVVM(Model View ViewModel)

ModelView ViewController ViewModelReactiveCocoa

Page 12: Reactive Cocoa && MVVM

Demo

• Do it

Page 13: Reactive Cocoa && MVVM

Next Class

Page 14: Reactive Cocoa && MVVM

Q&A

Thank you