About these pieces

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

Swipe Deck is a gesture-driven card stack: the top card follows the finger and swings from its base, an outcome badge fades in for the direction you are heading, and a flick throws it left, right or up while the cards beneath rise. Flip Card turns by tap or by a sideways drag that scrubs the rotation, lifting toward you mid-turn.

Motion Card tilts with the device's attitude through Core Motion, with a sheen and shadow that slide as it turns, and stops listening whenever the scene is not active. Parallax Card lets its image drift slower than the scroll while its caption block drifts slower still, so the card reads in layers.

Learn the technique: SwiftUI cards guide, 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 make a swipeable card stack in SwiftUI?

Stack the cards in a ZStack, attach a DragGesture to the top one, rotate it from a bottom anchor as it moves, and decide the throw from predictedEndTranslation so a flick counts. Swipe Deck does this over any Identifiable array and adds VoiceOver swipe actions.

How do I flip a card in SwiftUI?

Rotate the container with rotation3DEffect around the y axis and swap which face is visible at 90 degrees, rotating the back face 180 degrees so its content is not mirrored. Flip Card also lets a drag scrub the rotation.

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.