Polished Aluminum

Polished-aluminum finish layerEffect over any source view via a SwiftUI Metal stitchable shader — a tilt-shifted cyan/silver/purple brushed-metal gradient, a diagonal 45-degree rainbow iridescence band, and a tilt-tracking specular hotspot

Free
Free with a ShipSwift account.

Copies a short instruction with your private download link. Paste it into your agent: it downloads the whole skill (the source code, the setup steps and the mistakes we already made for you) and builds the screen.

Works with

+70

What it does

Wraps any view in a polished-aluminum finish through SwiftUI's layerEffect Metal pipeline, in three layered steps: (1) a tilt-shifted cyan → silver → purple vertical gradient with brushed-metal value noise forms the metal base; (2) a diagonal 45-degree rainbow band sweeps across via screen blending for iridescence; (3) a tilt-tracking specular hotspot finishes the lit-metal look. Feed tilt from a DragGesture to rotate the metal — the finish reads as a still, reflective surface that comes alive on drag.

Requires iOS 18+ / macOS 15+.

What you get

  • ✓432 lines of source code, ready to paste
  • ✓Attribution
  • ✓File Layout
  • ✓Source Code
  • ✓Usage
  • ✓Parameters
  • ✓Integration Checklist
  • ✓Notes / Gotchas
animationmetalshadermetal-finishaluminumiridescentlayerEffectcardSwiftUI

Usage

// Default — polished metal, still until tilted
SWPolishedAluminum {
    Image("photo").resizable().scaledToFill()
}
.frame(width: 250, height: 350)
.clipShape(RoundedRectangle(cornerRadius: 16))

// Let the underlying art show through more — lower intensity
SWPolishedAluminum(intensity: 0.6) { cardArtwork }

// Tilt-driven from a DragGesture
@State private var tilt: CGSize = .zero

SWPolishedAluminum(tilt: tilt, intensity: 0.85) { cardArtwork }
    .gesture(
        DragGesture()
            .onChanged { v in
                tilt = CGSize(width: v.translation.width / 100,
                              height: v.translation.height / 100)
            }
            .onEnded { _ in withAnimation(.spring) { tilt = .zero } }
    )

Parameters

ParameterTypeDefaultRangeNotes
tiltCGSize.zero~ -1…1 per axisLight/parallax direction, usually drag-driven
intensityFloat0.850…1Blend of the metal finish over the source — at 1 the metal nearly replaces the art
speedFloat1.0—Kept for API symmetry with the foil family; the finish has no time-driven motion, so it has no visible effect
showsControlsBoolfalse—Demo-only gear ToolbarItem; requires an enclosing NavigationStack

Integration Checklist

  1. Copy SWPolishedAluminum.swift and SWPolishedAluminum.metal into your Xcode target, keeping the MIT attribution header on both files.
  2. Confirm the deployment target is iOS 18+ / macOS 15+.
  3. Wrap a card / photo / SF Symbol in SWPolishedAluminum { ... }; clip it to a RoundedRectangle.
  4. The default intensity of 0.85 makes a strongly metallic surface; drop toward 0.5–0.6 if you want the underlying artwork to remain visible through the finish.
  5. Drive tilt from a DragGesture so the gradient, rainbow band, and specular hotspot all rotate together.

Notes / Gotchas

  • The shader's time argument is unused — the look is driven entirely by tilt, so with a fixed tilt the finish is static. There is no TimelineView: the layer re-renders only when tilt or intensity change, so a still card costs nothing per frame. Provide a tilt source if you want motion.
  • The metal color ramp (cyan / silver / purple) is baked into the shader, not parameterized. Edit the silver / darkSilver / cyan / purple constants in the .metal file to recolor the finish.
  • The four helpers (swAlu_*) are vendored from ShaderKit and prefixed to avoid duplicate-symbol collisions when several SW Metal files coexist in one shader library. Keep the prefix if you adapt them.
  • maxSampleOffset is .zero (the shader reads only the pixel under position). Do not raise it.

More in Effects and animation

Metal shaders: fields of dots that roll like waves and flow into living patterns, all drawn on the GPU.
Metal dot fields
Free
Metal shaders: fields of dots that roll like waves and flow into living patterns, all drawn on the GPU.
A deep-space starfield in Metal: glowing nebulae drift past twinkling stars.
Deep-space starfield
Free
A deep-space starfield in Metal: glowing nebulae drift past twinkling stars.
Neon outlines that bloom from the center with prism-colored edges, rendered live in Metal.
Neon outlines
Free
Neon outlines that bloom from the center with prism-colored edges, rendered live in Metal.
Colored blobs that drift, melt into one another like liquid, and blend their colors as they merge.
Liquid metaballs
Free
Colored blobs that drift, melt into one another like liquid, and blend their colors as they merge.
A 3D network graph you can spin. Tap any node and its links light up, with the details below.
3D network graph
Free
A 3D network graph you can spin. Tap any node and its links light up, with the details below.
Items orbit into a dotted ring, and payment cards fan out of a wallet as the balance rolls in.
Orbit ring and wallet
Free
Items orbit into a dotted ring, and payment cards fan out of a wallet as the balance rolls in.
A field of bright colored dots that float and shimmer across the whole screen.
Floating color dots
Free
A field of bright colored dots that float and shimmer across the whole screen.
Stacked glass panels in mirrored layers, with neon gradients flowing through them.
Glass color panels
Free
Stacked glass panels in mirrored layers, with neon gradients flowing through them.
Drag the slider and scattered points of light pull together into a perfect 3D sphere.
Dot sphere
Free
Drag the slider and scattered points of light pull together into a perfect 3D sphere.
Living patterns: a mosaic of cells that keeps reshaping, then a hypnotic color swirl.
Cells and swirl
Free
Living patterns: a mosaic of cells that keeps reshaping, then a hypnotic color swirl.
Organic noise shaders: glowing veins that pulse through the dark, then bold color blobs in constant flow.
Noise veins and blobs
Free
Organic noise shaders: glowing veins that pulse through the dark, then bold color blobs in constant flow.