Swift as Light
summary
Builds an iOS pipeline for Glowforge that traces images and turns SVG groups into interactive coaster views, using CoreGraphics for Bezier paths, a flood‑fill region selection to find border pixels, 2D→1D buffer arithmetic to map touches to pixels, and a CGAffineTransform pivot fix (translate, apply transform, translate inverse) to align SVG origin rotations with iOS centers. Documents why CGPath bounding boxes misposition layers, how sublayer/subview placement and transforms get fixed, and why value types + unit and integration tests prevent destructive prints in production.
AI-written summary · about
chapters (26)
- 0:00Intro
- 0:12The Glowforge
- 1:07Picture
- 1:26Vector Graphics
- 1:48Swift Coaster
- 2:25Fundamentals
- 2:57Owl Trace
- 3:09Trace: Adding Cut Outs
- 4:12Algorithm: Flood Filling
- 4:30Flood Filling: Recursive
- 4:43Pixels and Neighbors
- 6:21Coasters SVG
- 6:50Drag Group: Layer & Image
- 7:06Drag Group: Moving
- 8:11The Image
- 8:39Image Model
- 9:04Drag Group View
- 9:17Layer: Drawing and Positioning
- 9:42Way off
- 11:26Drag Group Image
- 11:36BitmapimageView: Transform
- 12:38Transformations: 15
- 13:19How do we fix?
- 13:48Moving Pivot: Center
- 14:55Safety
- 16:49Swift as Light
related talks
07mExploring SwiftUI Path Animations featuring Japan Symbol Quiz
38mBuilding Responsive Interactions
21mUsing Swift to Visualize Algorithms
25mAI-Assisted Swift in Gamifying an iOS App
33mSpecial effects with SwiftUI
34mFunctional Geometry in Swift & SwiftUI
35mAnimations with SwiftUI
25mSpecial effects with SwiftUI Text
