
Story Viewer
An Instagram-style stories experience. Tapping an avatar zooms the full-screen viewer out of it using the native iOS 18 zoom transition. Swiping between people turns a 3D cube, tapping steps through frames, holding pauses, and swiping down shrinks the viewer back into the avatar of whoever you were watching. Includes segmented progress bars, a Ken Burns drift, likes and watched rings.
- transition
- gallery
- gesture
snippet.swift499 lines
9 files • Scroll to see all →
/// One frame inside a user's story. Artwork is a mesh gradient plus an SF Symbol,/// so the snippet needs no image assets — swap `StoryViewerFrame` for your own media view.public struct StoryViewerStory: Identifiable, Hashable { public let id = UUID() let systemImage: String /// 9 colors for a 3×3 mesh gradient. let colors: [Color] let caption: String let timeAgo: String public init(systemImage: String, colors: [Color], caption: String, timeAgo: String) { precondition(colors.count == 9, "StoryViewerStory needs 9 colors (3×3 mesh).") self.systemImage = systemImage self.colors = colors self.caption = caption self.timeAgo = timeAgo }}public struct StoryViewerUser: Identifiable, Hashable {// ... (click "Show full code" to see more)Viewing: Model.swift•1 of 9