Advent · Day 7

This one opens on December 7.

Every door opens at midnight Pacific.

See the calendar

Pattern · Media

Photo Filters SwiftUI Block

Photo Filters SwiftUI Block is a paid SwiftUI pattern in SwiftPieces Pro. Live thumbnails of your own photo in twelve looks, an intensity slider for the chosen one and hold to see the original. iOS 17.0 and later. SwiftPieces Pro is $199 once.

Live thumbnails of your own photo in twelve looks, an intensity slider for the chosen one and hold to see the original.

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 looks tool of a photo editor as one section. A scrolling strip renders the actual photo in each of twelve looks once, off the main actor, with the name under each and a ring on the chosen one. An intensity slider blends the look with the photo, and holding the photo shows the original.

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

  • Twelve looks as live thumbnails of the actual photo
  • An intensity slider that blends the look with the photo
  • Hold the photo to compare with the original
  • A finishing closure so the strip shows your other edits
  • A Codable look with a Core Image apply(to:)

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 in the chosen look. Under it, a centred label reads the look and its strength, such as "Silvertone · 60", with Reset at the end once a look is chosen. A scrolling strip shows the actual photo in all twelve looks: Original, Vivid, Vivid Warm, Vivid Cool, Dramatic, Mono, Silvertone, Noir, Fade, Chrome, Instant and Process. Each look has its name underneath, and the chosen one is ringed and centred. The thumbnails render once per photo, off the main actor. An intensity slider blends the chosen look with the photo, and it is hidden on Original. Press and hold the photo to see the original, with a small Original tag.

Notes

  • PhotoFilterBlock(image:look:finishing:) binds a PhotoFilterBlock.Look, which is a Style and an intensity from 0 to 1.
  • finishing runs after the look, for display only. A screen that also adjusts the photo passes its adjustments here, so the stage and every thumbnail show the photo as it will come out.
  • look.apply(to:) is pure Core Image and nonisolated. The looks are built from CIPhotoEffect* filters and CIColorControls, CIVibrance, CIHighlightShadowAdjust and CITemperatureAndTint. It is blended with the original by CIDissolveTransition when the intensity is under 1.
  • Choosing a look plays a selection haptic and resets its intensity to full.
  • VoiceOver reads each thumbnail by its look and marks the chosen one, and the slider is adjustable in tenths.
  • PhotoFilterBlockExample is the preview: the painted sample photo in Silvertone at 60.

Theming

The block reads these tokens:

  • surface for the stage, fill behind thumbnails while they render.
  • textPrimary for the label, the chosen ring and name, and the slider's fill.
  • textSecondary for the other names.
  • surfaceElevated and separator for the slider's thumb.
  • radius.lg for the stage and radius.sm for the thumbnails.

03

Keep building

Pieces that work well next to this one.