Post Card

Post Card

A social post card with a swipeable photo carousel, page dots, animated counters, save and a live "Liked by" row. Double-tap the photo for a big heart pop that fills the like button.

Luiz Mello
  • card
  • carousel
  • interaction

snippet.swift523 lines

11 files • Scroll to see all →
/// One photo in a post. Artwork is a mesh gradient plus an SF Symbol, so the/// snippet needs no image assets — swap `PostCardSlideView` for your own image view.public struct PostCardSlide: Identifiable, Hashable {    public let id = UUID()    let systemImage: String    /// 3 colors, spread over a 3×3 mesh gradient.    let colors: [Color]​    public init(systemImage: String, colors: [Color]) {        precondition(colors.count == 3, "PostCardSlide needs 3 colors.")        self.systemImage = systemImage        self.colors = colors    }}​public struct PostCardPost: Identifiable {    public let id: String    let author: String    let handle: String    let location: String​// ... (click "Show full code" to see more)
Viewing: Model.swift•1 of 11