Docs
Media

Zoom DialNew

Preset stops in a glass capsule with a flowing red disc that widens into a fine dial when you hold it, like the camera zoom.

$npx swiftpieces add ZoomDial
Free · MIT + Commons ClauseiOS 17.0+Liquid Glasszoomdialcameraspeedstopsglasshaptics
Type
ZoomDial
Files
ZoomDial.swift
Depends on
Nothing (Apple frameworks only)
Version
1.0.0

Colors for ZoomDial. .standard is the house palette.

Notes

  • Preset stops sit in a glass capsule with the chosen one on a red disc that flows: its leading edge reaches the new stop first and the far edge follows, so it stretches and gathers in.
  • Press and hold for about a third of a second and the capsule widens into a dial: a ruler with a tick at each tenth and labels at each whole number, under a fixed red needle. Slide left to turn the value up. A selection haptic ticks at every tenth.
  • Let go and the capsule folds back. The disc moves to the nearest stop and shows the exact value, such as 1.6×.
  • One touch does both: a short tap picks the stop under it, a hold opens the dial. The value is clamped to range and kept to hundredths.
  • VoiceOver reads it as one adjustable element, "Zoom, 2×"; swipe up or down to step through the stops.
  • Under Reduce Motion the disc slides whole and the capsule changes width without overshoot.

Usage

ZoomDialExample()

Install

Pick one. Run it from the folder that contains your .xcodeproj and the files land inside your app.

Terminal

$npx swiftpieces add ZoomDial

Or ask your coding agent · Claude Code, Cursor or Xcode, once the MCP server is connected

>Add the SwiftPieces "Zoom Dial" piece to my app

Or copy the source above into your app.

New to SwiftUI?If you know React, CSS or Tailwind, SwiftUI is easier to pick up than it looks.Try real app patterns first

Building a whole app? See SwiftPieces Pro →

All media →

Build it yourself: SwiftUI animations guide

On this page

SwiftPiecesPro

Build the whole app with one library.

Production-ready screens, whole flows, complete app templates, a Build Kit your agent follows and Pro remixing.

Explore Pro