Pattern · Sheets and Alerts

New

What's New SwiftUI Block

A release notes sheet shown once per version: version and date, a title, features with symbols, Try it and Continue.

The sheet an app shows once after an update. The version and date sit over a title, three to five features come in one after another, one can link straight to the feature, and Continue closes it. A modifier keeps the last seen version in AppStorage and presents the sheet only when the release is newer.

  • SwiftUI
  • iOS 17.0+
  • whats-new
Get SwiftPieces Pro

$199 once, every piece included. See how installing works · Sign in

01

What's included

SwiftUI source you own, built on Apple frameworks only.

  • Version, date and a title in the display face
  • Three to five features, each a symbol, a title and one line
  • An optional Try it link that opens the feature
  • See all release notes opens your full notes
  • whatsNewSheet(_:) shows it once per version from AppStorage

02

Implementation notes

How it behaves, what it handles, and the decisions behind it.

The version and date sit over a title in the display face, then three to five features on one card, each with an SF Symbol, a title and one line. One feature can carry a Try it link that takes the person straight to it. Continue closes the sheet, and See all release notes opens your full notes. As the sheet appears, the features come in one after another. The whatsNewSheet(_:) modifier decides when to show it: it keeps the last version the person saw in AppStorage, presents the sheet once when your release is newer, and records the version when the sheet closes. A fresh install records the version without showing anything, unless you ask it to. Pass nil while the notes load and the block shows grey shapes in its own layout.

Notes

  • WhatsNewSheet(release:onTry:onSeeAll:onContinue:) takes one Release. It is the sheet's content: no scroll view, background or padding of its own, so it also works inline, for example on a Settings page that shows the latest release.
  • WhatsNewSheet.Release holds the version ("4.2", as in CFBundleShortVersionString), an optional date, the title, the features and an optional notesURL. Release.sample is the planner release from the preview.
  • Release.Feature is an SF symbol, a title, a one-line detail and an optional tryLabel. The first feature with a tryLabel shows it as a link when you pass onTry, which receives the feature.
  • See all release notes calls onSeeAll, or opens notesURL with openURL; with neither, it's hidden. Continue calls onContinue, or dismisses the presenting sheet.
  • .whatsNewSheet(_:showsOnFirstLaunch:onTry:) on your root view does the rest: it presents the block in a sheet with your theme's ground once per release. Try it closes the sheet before calling onTry.
  • WhatsNewSheet.VersionGate.shouldShow(release:lastSeen:current:showsOnFirstLaunch:) is the rule on its own: true when the release is newer than the last seen version and not newer than the installed app, compared numerically, so 4.10 is newer than 4.9. VersionGate.storageKey is the UserDefaults key, and VersionGate.currentVersion reads the bundle.
  • Haptics mark Continue with a success tap.
  • VoiceOver reads the version, date and title as one header, each feature as its title and line, and Try it as a button. At accessibility text sizes the symbols sit above the text so the words keep the width.
  • Reduce Motion shows every feature at once instead of one after another.
  • WhatsNewSheetExample at the end of WhatsNewSheet.swift is a planner's Today screen just after an update, with the notes in a sheet; Try week view closes it and switches to the week. Pass wrapsInNavigationStack: false to push it in your own stack.

Theming

  • Reads SPTheme from @Environment(\.spTheme) and requires the design-system item.
  • The title is the one display moment: type.face at 28 points, type.displayWeight capped at semibold, falling back to type.textDesign when figures are monospaced. The version line is type.footnote semibold in textSecondary.
  • The features card is color.surface at radius.lg with 16 point padding and separator hairlines inset to the text. Symbols are 22 points in textPrimary, titles type.headline, lines type.subhead in textSecondary, Try it type.subhead semibold in textPrimary.
  • Continue is the only accent: accent with accentOn in type.headline at radius.md. See all release notes is a plain textPrimary button.
  • Groups sit 24 points apart (space.xl); features come in with motion.smooth.