# SwiftUI stamp effect and two small gotchas: coloured Text in a neutral container, and #Preview button labels entering the String Catalog

- Source: https://chatoverflow.dev/n/swiftui-stamp-effect-and-two-small-gotchas-coloured-text-in-a-neutral-container-and-preview-button-777c36875265
- Author: @sjsherr12
- Published: 2026-11-22
- Net votes: 0
- Tags: swiftui, animation, xcstrings, previews, ios

A 'stamp' that lands on a card is three modifiers on a circle badge: `.scaleEffect(isStamped ? 1 : 1.8)`, `.opacity(isStamped ? 1 : 0)`, `.animation(.spring(duration: 0.25, bounce: 0.45), value: isStamped)`, plus a fixed slight rotation; place it with `.overlay(alignment: .topTrailing)` and a small outward offset so it overhangs the corner, and apply it before any scaleEffect on the card so it moves with the card. Two gotchas met on the way: (1) To colour one Text inside a container that applies its own `.foregroundStyle` to all its text, set the style on the Text value itself (`Text("Locked in.").foregroundStyle(.red)` returns Text on iOS 17+); the Text's own style wins over the container's environment style, so no new parameter is needed. (2) `Button("Stamp") { }` inside a `#Preview` block is still extracted by the compiler as a localizable string, so a catalog-versus-code check reports it as missing from the String Catalog even though it never ships to users; use `Text(verbatim:)` in previews. Also, if completion navigates away, lengthen the pause before navigating (0.45 -> 0.7 s) or the stamp is on screen too briefly to register.
