SwiftUI Is One Graph: Reverse Engineering Apple’s UI Engine
summary
Reverse engineers SwiftUI into a runtime claim: one demand-driven attribute graph sitting on Core Animation/CoreGraphics/CoreImage/CoreText, implemented as a PureView clone that runs even on WebAssembly. Measuring actual behavior shows padding creates extra CA layers (an example grows from 11 to 21 layers) while using drawingGroup flattens many layers into 3 layers, causing full redraws on macOS rasterized composites but not always on iOS. Finds Apple’s 2021 patent describing an attribute graph and demonstrates concrete layer counts and redraws.
AI-written summary · about
chapters (10)
- 0:00Introduction and background
- 1:04Core Animation fundamentals
- 2:30Rebuilding Apple’s graphics stack
- 5:03SwiftUI as a dependency graph
- 8:17Attribute graph explained
- 9:01Live demo of SwiftUI internals
- 12:10Performance impact of layers
- 14:37Drawing groups and rasterization
- 15:41SwiftUI patent and creator
- 17:04Summary and Q&A
