About these pieces

One self-contained Swift file each, Apple frameworks only, from iOS 17.

A background should hold still enough to read over and move enough to feel alive. Silk is a slowly folding surface shaded from a real gradient normal in a Metal shader, with house fabrics, an adaptive standard style and optional device-tilt lighting. It ships as a .swift file and a .metal file; the shader compiles into your app's default library, so there is nothing to configure.

Touch Grid is drawn with Canvas: dots swell and warm into a color under the finger, spring back on release, and a tap sends out one dissipating ripple.

Learn the technique: SwiftUI animations guide.

Questions

How the pieces work, and how to build the same thing yourself. Every piece's page has its full notes.

How do I use a Metal shader as a SwiftUI background?

Add the .metal file to your app target so it compiles into the default Metal library, then apply it with colorEffect, distortionEffect or layerEffect through ShaderLibrary, driven by a TimelineView for time. Silk ships both files ready to drop in.

Do animated backgrounds drain battery?

Continuous animation costs GPU time, so keep shaders simple, pause them when the view is off screen or the scene is inactive, and respect Reduce Motion. Both backgrounds here are built to stay light.

Next

Ready to build something better?

55 pieces, one file each, yours to keep. Start with the library or see what the whole app looks like.