The Swift Behind SwiftUI
summary
Starts from the SwiftUI template and reproduces the real errors: adding a print forces a required return because of implicit single-expression rules; opaque return type (some View) demands a single concrete view so if/else branches must match; demonstrates function builders (ViewBuilder) behind VStack syntax; shows @State implemented with property wrappers and builds a working slider bound to state. Includes a rounding property-wrapper example, a mood app that maps model→viewmodel with map, and Combine examples using map and flatMap to decode notifications without dropping the subscription.
AI-written summary · about
chapters (6)
- 0:00Swift syntax enhancements
- 4:58Opaque return types
- 8:12Working with function builders
- 10:30Property wrappers in action
- 16:17Map for collections and optionals
- 23:05Combine with map and flatMap








