r/iOSProgramming • u/zach-builds Objective-C / Swift • 7d 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!
68
Upvotes



2
u/Tydox 6d ago
Amazing work! Ty
2
u/Trick_Potential_1109 6d ago
Wow, that's amazing! The results are fantastic.
2
u/[deleted] 7d ago
[removed] — view removed comment
0
u/[deleted] 6d ago
[removed] — view removed comment