==
since SwiftUI is value type
everytime you use reference type, use @ObjectBinding
@State
view local
value type
framework managed
BindableObject:
external
reference type
developer managed
@EnvironmentObject > @ObjectBinding
[use EnvironmentObject to pass data around view hierarchy indirectly
while ObjectBinding just to pass from superview to nearest child view (subsequently)]
@State > @Binding
super View should have @State
child View should have @Binding
superView @State [pass]-> childView @Binding
References: (note to self, add new articles on the top)
SDK diffs:
== since SwiftUI is value type everytime you use reference type, use @ObjectBinding
@State
BindableObject:
@EnvironmentObject > @ObjectBinding [use EnvironmentObject to pass data around view hierarchy indirectly while ObjectBinding just to pass from superview to nearest child view (subsequently)]
@State > @Binding
super
View
should have @State childView
should have @Binding superView @State [pass]-> childView @Bindingreference: https://developer.apple.com/wwdc19/226
--
TIL: SwiftUI List and ForEach reuse cell internally
https://twitter.com/jckarter/status/1143704650215858177?s=20
--
SwiftUI together with Combine will change everything we knew about iOS/macOS/tvOS/watchOS or whateverOS development