Advent · Day 7

This one opens on December 7.

Every door opens at midnight Pacific.

See the calendar

Pattern · Media

Photo Adjust SwiftUI Block

Photo Adjust SwiftUI Block is a paid SwiftUI pattern in SwiftPieces Pro. Thirteen photo adjustments on dials, a ruler slider with a detent at zero, Auto from the histogram and a live histogram. iOS 17.0 and later. SwiftPieces Pro is $199 once.

Thirteen photo adjustments on dials, a ruler slider with a detent at zero, Auto from the histogram and a live histogram.

Buyers also search for this as a SwiftUI section.

Facts
Price$199 once
iOSiOS 17.0 and later
LicenseA per-developer commercial license for unlimited personal and commercial apps, including client work. Do not resell or redistribute the source as a template or UI kit.
DependenciesNo third-party packages. Apple frameworks only.
Files1 Swift file in the install.

The light and colour tool of a photo editor as one section. A row of dials shows every adjustment's value in its ring, from Exposure to Vignette, and a ruler slider sets the chosen one with a haptic detent at zero. The photo renders live off the main actor with a small luminance histogram in its corner, Auto sets a starting point from that histogram, and holding the photo shows the original.

  • SwiftUI
  • iOS 17.0+
  • photo-adjust
Get SwiftPieces Pro

$199 once, every piece included. See how installing works · Sign in

Proof

This targets iOS 17.0 and later. On iOS 26 it uses Liquid Glass. On iOS 17 through iOS 18 it uses a material fallback, including when Reduce Transparency is on.

No simulator still is published for this page yet.

01

What's included

SwiftUI source you own, built on Apple frameworks only.

  • Thirteen adjustments, each ring showing its value
  • A ruler slider with a detent at zero and double tap to reset
  • Live rendering off the main actor, keeping the last frame
  • A live luminance histogram and Auto from it
  • Hold the photo to compare with the original

Used in

Photo Editor (screen)

02

Implementation notes

How it behaves, what it handles, and the decisions behind it.

The photo sits on a stage with the adjustments applied live, and a small luminance histogram in its top corner follows every change. Under it, a row reads Auto, the chosen adjustment with its value (such as "Exposure +12"), and Reset once anything has changed. A scrolling row of dials holds all thirteen adjustments: Exposure, Brilliance, Highlights, Shadows, Contrast, Brightness, Black Point, Saturation, Vibrance, Warmth, Tint, Sharpness and Vignette. Each is an SF Symbol in a 38 point ring. The ring's stroke grows clockwise for positive values and counterclockwise for negative ones, in the accent on the chosen dial. A ruler slider sets the chosen adjustment, with its fill running from the centre. It has a detent and a light haptic at zero, and a double tap resets that value. Auto reads the photo's histogram and sets exposure, contrast, black point, highlights, shadows and a little vibrance. Press and hold the photo to see the original.

Notes

  • PhotoAdjustBlock(image:values:) binds a PhotoAdjustBlock.Values. Passing nil draws a ghost.
  • Values holds thirteen Doubles, 0 meaning untouched. Most run -100...100, while Sharpness and Vignette run 0...100. It is Sendable, Equatable and Codable, and you can subscript it by PhotoAdjustBlock.Adjustment.
  • values.apply(to:) is pure Core Image and nonisolated. It chains exposure adjust, highlight and shadow, a tone curve (positive highlights, black point and negative brilliance), colour controls, vibrance, temperature and tint, luminance sharpening and a vignette, and it keeps the photo's extent.
  • The preview renders at 1000 pixels in a detached task. A new change cancels the render in flight, and the last frame stays up until the next one lands.
  • The histogram is CIAreaHistogram over 64 bins, read back and combined into luminance.
  • VoiceOver: each dial reads its name and value. The slider is adjustable in steps of five and reads the chosen adjustment.
  • PhotoAdjustBlockExample is the preview: the painted sample photo, warmed and lifted (Values.sample).

Theming

The block reads these tokens:

  • surface for the stage.
  • textPrimary for the labels, the chosen symbol and the slider's fill.
  • textSecondary for the other dials and their rings, separator for the empty rings.
  • accent for the chosen dial's ring.
  • fill for the slider's track, textTertiary for its centre tick, surfaceElevated for its thumb.
  • radius.lg and motion.snappy/motion.smooth.

The histogram is white on a dark scrim in every family.

03

Keep building

Pieces that work well next to this one.