Template · Commerce

Subscription App SwiftUI Template

Cadence, a subscription habit tracker: a complete Xcode project with onboarding, a StoreKit 2 paywall, SwiftData, widgets and three brand presets. 16 screens and 4 flows in Cadence, as a SwiftUI app template.

A complete subscription app. First run is three welcome pages, a reminders request, Sign in with Apple and a StoreKit 2 paywall; after that the app opens on a four-tab shell: Today, Habits, Insights and Settings. What's New, habit details and the editor, upgrading from Settings and signing out back to first run are all connected.

  • SwiftUI
  • iOS 17.0+
  • Xcode project 1.0.0
  • subscription-app
16 Screens4 Flows
Get SwiftPieces Pro

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

01

Flows

Complete journeys through Cadence, from first launch to sign out, screen by screen. Open one to play it, or choose any screen to start there.

The first 3 steps of every flow are open. Pro opens every screen of every template, live in each style, and the SwiftUI to build them.

01 · Onboarding

First Run

From the welcome pages through reminders, Sign in with Apple and the Pro trial to Today.

7 Screens12 Steps
Play the flow
  1. 01Small Things, Every Day
  2. 02Streaks That Forgive
  3. 03See What's Working
  4. 04Reminders
  5. 05Allow Notifications
  6. 06Reminders
  7. 07Sign In
  8. 08Sign In With Apple
  9. 09Cadence Pro
  10. 10Cadence Pro
  11. 11Cadence Pro
  12. 12Today

02 · Core Journey

Check In For The Day

Check habits off from Today and from a habit's page, then see how the month went in Insights.

4 Screens11 Steps
Play the flow
  1. 01Today
  2. 02What's New
  3. 03What's New
  4. 04Check Off A Habit
  5. 05Habit Detail
  6. 06Habit Detail
  7. 07Habit Detail
  8. 08Today
  9. 09Insights
  10. 10Insights
  11. 11Insights

03 · Core Journey

Start A Habit

Go from an empty list to a first habit and mark it done on its page.

3 Screens6 Steps
Play the flow
  1. 01Habits
  2. 02New Habit
  3. 03New Habit
  4. 04Habits
  5. 05Habit Detail
  6. 06Habit Detail

04 · Profile And Settings

Profile And Settings

Upgrade from Settings, choose an appearance and a theme, export the history and sign out.

6 Screens11 Steps
Play the flow
  1. 01Settings
  2. 02Upgrade To Pro
  3. 03Cadence Pro
  4. 04Settings
  5. 05Settings
  6. 06Appearance
  7. 07Theme
  8. 08Export History
  9. 09Settings
  10. 10Settings
  11. 11Small Things, Every Day

02

Screens

Every screen in Cadence, 16 in all, each a SwiftUI view in the Xcode project. In Candy, Studio and Graphic, light and dark.

First run

Welcome, permissions and the questions that set the app up.

Account and subscription

Sign in, verification and the paywall.

  • Sign In

    Signs in with Apple to back up habits, or continues without an account and keeps them on this iPhone.

  • Cadence Pro

    Offers Pro with four benefits, Yearly and Monthly side by side and a seven-day trial on Yearly.

    Built onPaywall

Tabs

Where the app opens, one screen per tab.

  • Today

    Shows the day's progress as a giant count, this week as bars and the habits still due as blocks to check off.

    Built onApp ShellLessons

  • Habits

    Lists every habit with its schedule, last seven days and streak, or the ghost state before the first one.

    Built onProjectsApp ShellLessons

  • Insights

    Compares the week or month with the period before, names the strongest and hardest days and ranks each habit.

    Built onApp ShellLessons

Details and sheets

What the tabs push and present.

  • Habit Detail

    One habit's streak, stats and history, where today is marked done and missed days are fixed.

    Built onApp Shell

  • New Habit

    Names a habit and sets its symbol, days, reminder and note.

  • What's New

    The release's changes as a bento grid of blocks that open into their detail.

    Built onWhat's New

Profile and settings

The account, preferences, the subscription and sign out.

  • Settings

    The account and plan, reminders, theme and appearance, data export, support and sign out.

    Built onSettingsApp ShellLessons

  • Appearance

    Sets the app and its widget to follow the system, or stay light or dark.

    Built onSettings

  • Theme

    Switches between Candy, Studio and Graphic, previewed on a sample card.

  • Export History

    Shares every check-in as a CSV spreadsheet.

03

Built from the library

The library screens this template wires together, in the order someone meets them. Each one installs on its own too.

04

What's included

SwiftUI source you own, built on Apple frameworks only.

  • Onboarding with a real notifications request and Sign in with Apple, handing off to a StoreKit 2 paywall
  • A four-tab shell with habit detail pushes and a ghost state for an empty list
  • A What's New sheet for the 2.0 release
  • Settings with reminders, appearance, subscription and sign out
  • One root view, SubscriptionApp, with your product ids and completion key as parameters

Includes

Onboarding, Welcome, Purchase, Paywall, App Shell, Lessons, Projects, What's New, Settings. Installed together, automatically.

Requires

In-App Purchase capability

In the Build Kit

Subscription Utility (brief). Your agent builds around this template in the same design.

05

Implementation notes

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

SubscriptionApp is one root view. On first launch it shows the Onboarding screen: three welcome pages, a notifications request, then the Purchase screen's StoreKit 2 paywall as the handoff. Purchasing, restoring or closing the paywall finishes onboarding and records it under a completion key, so the root switches to the home on its own.

Home is the App Shell with five tabs: Today, Habits, Projects, Insights and Profile. Today presents What's New for the 2.0 release as a sheet. Projects starts from a ghost state. Profile pushes Settings, where Manage subscription reopens the paywall full screen and Sign out clears the completion key and returns the app to first run.

Adapting it

  • Products: pass your App Store Connect ids as productIDs. Until they exist, the paywall shows its designed "plans didn't load" state and its close button still finishes onboarding.
  • Completion key: completionKey is the UserDefaults key the flow writes and the root reads. Change it to show onboarding to everyone again, for example after a redesign.
  • Sample data: onboarding copy lives in OnboardingFlowScreenExample.pages and .permission, the tabs in CadenceTab, projects in GhostStateBlockExample, release notes in BentoGridBlockExample, and the account and settings rows at the top of SubscriptionApp.swift.
  • Theme: every screen reads the Design System. Set .environment(\.spTheme, PaperTheme()) or your own theme once on SubscriptionApp to re-skin the whole app.

Notes

  • Not @main: put SubscriptionApp() in your own WindowGroup.
  • Enable the In-App Purchase capability before testing purchases.
  • Three previews ship with the file: first run, home, and home in Paper dark.