Docs
Sheets

Permission Sheet

A pre-permission sheet that previews what it brings as a stack of notification banners before the request.

$npx swiftpieces add PermissionSheet
See it in a Pro app On a real screen in one of the Pro apps: open it with Pro, take it apart, remix it, and copy the SwiftUI.
Free · MIT + Commons ClauseiOS 17.0+Liquid Glasspermissiononboardingsheetasynchaptic
Type
PermissionSheet
Files
PermissionSheet.swift
Depends on
Nothing (Apple frameworks only)
Version
3.0.0
In a full screen · SwiftPieces ProOnboardingFirst run end to end: welcome pages, a permission step and a trial offer, then into the app.

Explains a permission, runs the real request, and reacts to the result.

Notes

  • The sheet previews what the permission brings. Your benefits become a fanned stack of notification banners above the title: each is a solid card with its symbol on a tinted app tile (butter, sage and lilac in order by default), its line, and "now". The two behind the front banner sit a little smaller, lower and a shade darker, so their edges read as separate cards. Keep each line short, like a notification ("Design review in 30 minutes"). Without benefits the sheet leads with the icon tile instead.
  • Present it in a .sheet with .presentationBackground(PermissionSheet.Style.standard.surface), sized to its content (the example measures it for a .height detent); it also works inline in any container. The title and message are centred under the stack. About 0.3 s in, once a sheet has settled, the banners drop in from above, the front one first and the rest 90ms apart behind it.
  • While the sheet waits for an answer, the stack deals its next banner to the front every 2.6 s on the settle spring, so each benefit gets read. It stops once the request is tapped, and never runs under Reduce Motion. VoiceOver reads the whole stack as one element listing every benefit.
  • request is your real permission call (for example UNUserNotificationCenter.requestAuthorization). The request is a signal glass capsule that sinks under the finger; a tap brings in a spinner and morphs its label letter by letter to Requesting until the call returns. Nothing waits on an animation: the button's action and enabled state change the moment the answer arrives.
  • true pops the stack and plays .success, morphs the button to Allowed with a check on sage glass while the Not now capsule melts up into it (its place keeps its size, so the button never shifts), then calls onGranted about a second later so you can dismiss. Without benefits the tile turns sage with a check instead.
  • A denial stays calm, with no shake: the stack greys out to half strength, which reads as notifications off, and .warning plays. The title and message lift away through a blur and the denied copy rises into their place, and the button morphs to Open Settings on glass the label's color and opens UIApplication.openSettingsURLString. Without benefits the tile turns sand with a gear.
  • Requesting, Allowed, Open Settings and "now" go through String(localized:).
  • Style sets the surface, labels, the icon tile's colors, the banners' tile tints (benefitTiles, or [.clear] for neutral tiles), the action color and the tile radius.
  • On iOS 26 the request and Not now are Liquid Glass and melt into each other through the neck; before that they are frosted glass with a light rim, and with Reduce Transparency they are solid.
  • Under Reduce Motion nothing drops, blurs, bounces or pops: the banners fade in already stacked and are never dealt, the labels and the two copies crossfade in place, Not now fades where it rests, and the capsules dim while pressed instead of sinking. Haptics are unchanged.
  • At accessibility text sizes the button's label is plain text that can wrap, and changes with a blur instead of the letter morph.
  • v3: redesigned around a preview of the notifications themselves. The benefit rows became the banner stack, and the copy is centred under it. The public API is unchanged.
  • For a full multi-step onboarding flow, see the Onboarding screen in SwiftPieces Pro.

Usage

PermissionSheetExample()

Parameters

ParameterDescription
systemImageSF Symbol shown in the icon tile.
titleHeadline.
messageOne or two sentences of context.
benefitsWhat the permission brings, previewed as a stack of notification banners above the title, each its symbol on a tinted tile and its line. Keep each line short, like a notification. Without benefits the sheet leads with the icon tile.
allowTitlePrimary button title.
deniedTitleHeadline shown after the request returns false.
deniedMessageCopy shown after a denial, above the "Open Settings" button.
styleColors and tile shape. Defaults to the SwiftPieces house palette, adapting to light and dark.
requestAsync permission request; return true when granted. The button spins and reads Requesting until it returns.
onGrantedCalled about a second after a grant, once the tile has turned into a check. Dismiss the sheet here.
onSkipSecondary handler. Omit to hide the "Not now" capsule.

Install

Pick one. Run it from the folder that contains your .xcodeproj and the files land inside your app.

Terminal

$npx swiftpieces add PermissionSheet

Or ask your coding agent · Claude Code, Cursor or Xcode, once the MCP server is connected

>Add the SwiftPieces "Permission Sheet" piece to my app

Or copy the source above into your app.

New to SwiftUI?If you know React, CSS or Tailwind, SwiftUI is easier to pick up than it looks.Try real app patterns first

Building a whole app? See SwiftPieces Pro →

All sheets →

Build it yourself: SwiftUI haptics guide

On this page

SwiftPiecesPro

Build the whole app with one library.

Production-ready screens, whole flows, complete app templates, a Build Kit your agent follows and Pro remixing.

54 screens · 46 patterns · 48 flows · 12 templates · 31 Build Kit skills

Explore Pro