How to Think Like a SwiftUI ViewModifier
summary
Explains that a ViewModifier makes copies of the view and transforms each copy, so calling border/padding/background repeatedly stacks wrappers and order matters (padding before border, background after padding to include spacing). Shows the ViewModifier protocol (Content->View) and builds three concrete modifiers: a mirrored swipeable row with customizable buttons that uses an invisible ZStack to preserve row height and works with gestures, and a tap-to-unblur that uses state plus a DispatchWorkItem to reset blur.
AI-written summary · about
chapters (7)
- 0:00Intro
- 2:18Why SwiftUI
- 4:22First SwiftUI Experience
- 14:12What is a ViewModifier
- 22:41Reflection
- 26:18Tap to Unblur
- 38:51Wrap Up
related talks
34m_VariadicView: Highlighting the Hidden Powers of Containers
31mThe Swift Behind SwiftUI
36mSwiftUI Everywhere
28mSwiftUI for UIKit developers
30mCustom Styleable Containers in SwiftUI
35mSwiftUI Performance for Demanding Apps
29mCustom Styleable Containers in SwiftUI
27mLow-Hanging View Controller Fruits
