Advent · Day 7

This one opens on December 7.

Every door opens at midnight Pacific.

See the calendar

Screen · Media

Photo Editor SwiftUI Screen

Photo Editor SwiftUI Screen is a paid SwiftUI screen in SwiftPieces Pro. A full photo editor: crop and straighten, thirteen adjustments, looks and markup, with undo, redo and full-resolution export. iOS 17.0 and later. SwiftPieces Pro is $199 once.

A full photo editor: crop and straighten, thirteen adjustments, looks and markup, with undo, redo and full-resolution export.

Buyers also search for this as a iOS screen.

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. Also uses photo-crop, photo-adjust, photo-filters, photo-markup.
Files1 Swift file in the install.

A complete editing screen behind four tabs, Crop, Adjust, Filters and Markup, each one a SwiftPieces pattern you can also use on its own. Edits are non-destructive Codable values you can store and reopen, undo and redo cover the whole editor one gesture at a time, and Done renders the photo at full resolution through Core Image off the main actor.

  • SwiftUI
  • iOS 17.0+
  • photo-editor
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.

  • Crop, Adjust, Filters and Markup tabs, with a dot on each edited tab
  • Undo and redo across the whole editor, one step per gesture
  • Codable edits you store beside the original and reopen later
  • Done renders at full resolution off the main actor
  • Cancel asks before discarding, and Reset All starts over

Includes

Crop and Straighten, Photo Adjust, Photo Filters, Photo Markup. Installed together, automatically.

02

Implementation notes

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

A full-screen editor for one photo. The top bar has Cancel, undo and redo in the middle with a menu holding Reset All, and Done in the accent. Under it is the active tool, and four tabs along the bottom (Crop, Adjust, Filters and Markup) switch between them. A tab whose tool has an edit carries a small dot. Each tool is a SwiftPieces pattern: Crop and Straighten, Photo Adjust, Photo Filters and Photo Markup. Each tool is handed the photo with the other tools' edits already applied. Crop sees the whole photo uncropped, Filters shows its thumbnails through your adjustments, and Markup draws on the finished photo. Undo and redo cover the whole editor, one step per gesture: a change is recorded once the photo has been still for a moment. Done shows a spinner in place of its label while it renders the photo at full resolution off the main actor, then hands back the image and the edits. If that fails, an error line appears under the bar. Cancel asks before discarding changes. Press and hold the photo in Adjust or Filters to see the original.

Notes

  • PhotoEditor(image:edits:onDone:onCancel:). Present it full screen. onDone is @MainActor async throws and receives a PhotoEditor.Result with the rendered image and the edits. A thrown error shows under the bar, and CancellationError returns quietly.
  • PhotoEditor.Edits holds the crop, the adjustments, the look and the drawing. It is Codable, so store it beside the original and pass it back as edits to pick up where you left off. The original is never changed.
  • The final image is rendered in this order: the crop, then the look, then the adjustments, then the drawing on top. That is drawing.render(over:) of adjust.apply(to: look.apply(to: crop.apply(to: original))).
  • While you edit, the photo is scaled to 1600 pixels once. Each tool's input is rendered off the main actor when the edits it depends on change. Done renders the original at full size.
  • History keeps up to 60 steps. Reset All is a single step you can undo.
  • Haptics play for each tab change, on success and on failure.
  • VoiceOver reads each tab with "Edited" when it has an edit, and Done reads "Saving" while it works.
  • PhotoEditorExample is the preview: the editor on the painted sample photo in Studio. PhotoEditorLibraryExample is a host with Choose Photo (PhotosPicker) and Edit, which keeps the edits between sessions.

Theming

The editor reads these tokens:

  • bg for the screen.
  • textPrimary for Cancel, the controls, the chosen tab and the edit dots.
  • textSecondary for the other tabs, textTertiary for disabled undo and redo.
  • accent for Done, danger for the error line.
  • The type roles body, caption and footnote, and motion.snappy and motion.smooth.

The tools theme themselves as their own notes describe.

03

Keep building

Pieces that work well next to this one.