Pattern · Sheets and Alerts
NewWhat'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
$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 oneRelease. 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.Releaseholds theversion("4.2", as inCFBundleShortVersionString), an optionaldate, thetitle, thefeaturesand an optionalnotesURL.Release.sampleis the planner release from the preview.Release.Featureis an SFsymbol, atitle, a one-linedetailand an optionaltryLabel. The first feature with atryLabelshows it as a link when you passonTry, which receives the feature.- See all release notes calls
onSeeAll, or opensnotesURLwithopenURL; with neither, it's hidden. Continue callsonContinue, 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 callingonTry.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.storageKeyis theUserDefaultskey, andVersionGate.currentVersionreads 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.
WhatsNewSheetExampleat the end ofWhatsNewSheet.swiftis 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. PasswrapsInNavigationStack: falseto push it in your own stack.
Theming
- Reads
SPThemefrom@Environment(\.spTheme)and requires thedesign-systemitem. - The title is the one display moment:
type.faceat 28 points,type.displayWeightcapped at semibold, falling back totype.textDesignwhen figures are monospaced. The version line istype.footnotesemibold intextSecondary. - The features card is
color.surfaceatradius.lgwith 16 point padding andseparatorhairlines inset to the text. Symbols are 22 points intextPrimary, titlestype.headline, linestype.subheadintextSecondary, Try ittype.subheadsemibold intextPrimary. - Continue is the only accent:
accentwithaccentOnintype.headlineatradius.md. See all release notes is a plaintextPrimarybutton. - Groups sit 24 points apart (
space.xl); features come in withmotion.smooth.
03
Keep building
Pieces that work well next to this one.