Masonry Zoom Grid

Masonry Zoom Grid

A Pinterest-style two-column masonry grid of varied-height cards that balances its columns automatically. Tapping a card zooms its detail out of it with the native iOS 18 zoom transition, complete with a morphing Save button and related pins that zoom open too.

Luiz Mello
  • grid
  • card
  • transition

snippet.swift487 lines

9 files • Scroll to see all →
/// One pin in a `MasonryZoomGrid`. Artwork is a mesh gradient plus an SF Symbol,/// so the snippet needs no image assets — swap `MasonryZoomGridArtwork` for your own image view.public struct MasonryZoomGridItem: Identifiable, Hashable {    public let id: String    let title: String    let creator: String    let systemImage: String    /// 3 colors, spread over a 3×3 mesh gradient.    let colors: [Color]    /// Height ÷ width of the artwork. Varied ratios are what make the masonry.    let aspect: CGFloat    let saves: Int    let summary: String    let tags: [String]​    public init(        title: String,        creator: String,        systemImage: String,        colors: [Color],​// ... (click "Show full code" to see more)
Viewing: Model.swift•1 of 9