Custom Styleable Containers in SwiftUI
summary
Shows how to build true styleable containers using iOS 18 APIs: subviews collection to safely enumerate and expand conditionals/ForEach, container values to read child tags and preferences upward, and dynamic property so styles can use property wrappers. Implements a custom TabView (~150 lines) that supports grid, menu and overflow behaviors, toggles how many tabs render, and works without AnyView or custom result builders. Code runs and demos selection, reordering, and dynamic styling.
AI-written summary · about
chapters (13)
- 0:00Introduction and speaker intro
- 1:06About the talk and speaker
- 2:10What is a SwiftUI container
- 3:35Challenges of custom containers
- 6:45New APIs in iOS 18
- 9:13Subviews collection explained
- 10:17Container values overview
- 13:09Styling containers
- 14:53Dynamic property protocol
- 18:48Demo introduction
- 21:19Demo code walkthrough
- 25:13Running the demo
- 27:40Summary and resources








