SwiftUI + Combine note
vinhnx opened this issue ยท 2 comments
References: (note to self, add new articles on the top)
- https://duan.ca/2019/07/01/combine-hygiene/
- https://www.cocoawithlove.com/blog/twenty-two-short-tests-of-combine-part-1.html
- https://www.objc.io/blog/2019/07/02/lazy-loading/
- https://medium.com/flawless-app-stories/will-combine-kill-rxswift-64780a150d89
- https://medium.com/flawless-app-stories/problem-solving-with-combine-swift-4751885fda77
- https://github.com/learncombine/Combine101
- https://benoitpasquier.com/first-steps-apple-combine-framework-swift/
- https://github.com/AvdLee/CombineSwiftPlayground
- https://heckj.github.io/swiftui-notes/ ๐
- https://github.com/Juanpe/About-SwiftUI
- https://heckj.github.io/swiftui-notes/combine/
- https://github.com/kitasuke/SwiftUI-MVVM
- https://github.com/Jinxiansen/SwiftUI
- https://developer.apple.com/documentation/swiftui/state
- https://developer.apple.com/documentation/swiftui/state_and_data_flow
- https://github.com/vinhnx/CombineUnsplash // my own example, updating...
- https://github.com/chinsyo/awesome-swiftui
- https://mobile.twitter.com/peres/status/1136370518091751424
- https://gist.github.com/RuiAAPeres/d33e123f2df40d58162b29bec786a859
- https://mjtsai.com/blog/2019/06/03/swiftui-and-combine/
- https://wwdcbysundell.com/2019/swiftui-common-questions/
- https://mobile.twitter.com/johnsundell/status/1136194261941198848
- https://www.hackingwithswift.com/articles/194/get-started-with-swiftui
- https://wwdcbysundell.com/2019/swiftui-first-look/
SDK diffs:
- SwiftUI: https://gist.github.com/chriseidhof/b770a50641e3c430112bc404ca430b82/revisions?diff=unified
- Combine: https://gist.github.com/broadwaylamb/c2c8550d76b3ff851c4c1dbf0a872e26/revisions
==
since SwiftUI is value type
everytime you use reference type, use @ObjectBinding
- 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)]
super View
should have @State
child View
should have @binding
superView @State [pass]-> childView @binding
reference: 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