r/iOSProgramming • u/zach-builds Objective-C / Swift • 13d ago
Library SwiftUI + Metal Foil Effect: Source Code on GitHub
I've always appreciated a nice visual to represent software license status (shoutout Arc and 1Password circa 2016), and spent more time than I'd like to admit editing shaders for this
If you're looking for a similar effect for your own app, the source is available here:
One line of SwiftUI.
.foilSticker()on any view, orFoilCard { }for the full card.Runs on the GPU. Two Metal shaders render the foil live on any artwork (I use a 1280x720px image, included in the repo)
Follows the cursor. 3D tilt, a moving highlight and a shifting rainbow, all with transitions/easing so it feels smooth
Tunable. 11 settings + an unlock animation + easily extendable
Yearly stamps. Optionally show yearly membership stamps on the card
Compatibility. macOS 14+ and iOS 17+. No dependencies, Swift 6.
MIT licensed. The shaders are adapted from the original Sticker repo by Benjamin Pisano, with additional options, transitions, and tweaks added
Happy to answer questions about the implementation!
Duplicates
SwiftUI • u/zach-builds • 13d ago


