SwiftUI photo and media components
A full-screen photo viewer with pinch to zoom, and a Stories-style progress strip with hold to pause.
About these pieces
One self-contained Swift file each, Apple frameworks only, from iOS 17.
Photo Viewer is a full-screen photo surface with anchor-correct pinch zoom, momentum panning that settles into the bounds, double-tap zoom about the tap, paging between images, and pinch-out or drag-down to dismiss.
Story Strip is a Stories-style segment strip with a built-in clock, a long-press hold that pauses it, tap zones for back and forward, and a manual progress mode when you own the timing.
Learn the technique: SwiftUI animations guide.
Questions
How the pieces work, and how to build the same thing yourself. Every piece's page has its full notes.
How do I add pinch to zoom on an image in SwiftUI?
Combine MagnifyGesture for scale with a DragGesture for panning, anchor the zoom at the pinch location, and clamp the offset to the image bounds. Photo Viewer handles all of that plus double-tap zoom and paging.
Keep browsing
Nearby collections, then every category in the library.
- MotionGesture modifiers with real physics.1
- CardsCards with depth, motion, parallax and gesture-driven stacks.4
- NavigationFloating docks, tracking tabs and stretchy headers.3
- TextType that reveals, expands and renders as glass.3
- BackgroundsQuiet atmospheres: a Metal silk shader and a touch-reactive dot grid.2
- Liquid GlassCorrect iOS 26 Liquid Glass with Material fallbacks.3
- Buttons and controlsButtons and dials with press depth, hold, drag and outcome states.5
- Inputs and formsTracks, steppers, rails and fields built for the thumb.9
- ListsRows and carousels with swipe, depth and completion physics.5
- SheetsToasts, confirmations and permission moments.3
- FeedbackReactions, ratings, status morphs, skeletons and outcomes.5
- Data and chartsScrubbable charts, rings, live stats and odometers.4
- AIStreaming replies, thinking states, prompt chips and code.6
- AnimationsSprings, gesture physics, transitions and morphs, across every category.16
- HapticsPieces that tick, tap and confirm at the moment that matters.19
Ready to build something better?
55 pieces, one file each, yours to keep. Start with the library or see what the whole app looks like.