Permission Cards

Permission Cards

A deck of permission requests for notifications, location and photos, each with its own animated symbol illustration. Allow or Not now (or a swipe) flings the top card away, the next springs forward, and every decision is reported through a callback.

Luiz Mello
  • card
  • stack
  • interaction

snippet.swift474 lines

7 files • Scroll to see all →
public enum PermissionCardsDecision: String, Hashable {    case allowed, skipped}​/// Which animated illustration a card shows in its hero area.public enum PermissionCardsIllustration: Hashable {    case notifications    case location    case photos    /// Any other permission: a single symbol with a periodic bounce.    case symbol(String)}​public struct PermissionCardsRequest: Identifiable, Hashable {    public let id: String    let title: String    let message: String    let allowTitle: String    let tint: Color    let illustration: PermissionCardsIllustration​// ... (click "Show full code" to see more)
Viewing: Model.swift•1 of 7