StanFordiOS2020记录
1.MVVM
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
3.Struct vs Class deferences
4.Generics (don’t care type)
5.Function as Types
6.Demo
7.Lectue3 Reactive UI,Protocol,Autolayout
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
8.Demo 3.2.View model observe model changes
ObservableObject
objectWillChange.send()
@Published
9.Demo 3.3. View change symultaneously
@ObservedObject
10.Protocol
It’s a type