SanFordiOS2020记录

StanFordiOS2020记录

1.MVVM

Snip20200608_2

1.ViewModel

​ 1.Bind View to Model

​ 2.Interpreter

​ 3.Processes Intent

​ 4.publish something changed to View

2.Model

​ 1.Data + Logic

​ 2.The truth

​ 3.UI Independent

​ 4.noticc changes to ViewModel

3.View

​ 1.Reflect Model

​ 2.stateless

​ 3.Reactive

​ 4.calls ViewModel Intent functions

2.Struct vs Class same things

Snip20200608_8

Snip20200608_9

3.Struct vs Class deferences

Snip20200608_4

4.Generics (don’t care type)

5.Function as Types

Snip20200608_11

6.Demo

Snip20200608_14

Snip20200608_15

Snip20200608_16

Snip20200608_17

Snip20200608_20

Snip20200608_23

7.Lectue3 Reactive UI,Protocol,Autolayout

Snip20200608_30

2.viewModel is door way to Model,but never talk to View

3.View talk to view Model

4.Model may need ViewModel imply function

5.declarative progrmming(Swift) vs imperative programming

6.can’t make var in ZStack

7.Demo3.1.change the boolen state of card from Array

Snip20200608_32

8.Demo 3.2.View model observe model changes

ObservableObject
objectWillChange.send()
@Published

Snip20200608_33

9.Demo 3.3. View change symultaneously

@ObservedObject Snip20200608_34

10.Protocol

Snip20200608_36

It’s a type

Snip20200608_37

Snip20200608_37

11.LayoutSnip20200608_43