Swift PiecesPro
  • Library
    Screens48Finished, designed screens for real apps.Templates10Complete apps built from the screens.Build Kit24Styles, briefs and recipes for your coding agentEverything58The whole library, with search
  • Docs
  • Pro

Library

  • Screens48
  • Templates10
  • Build Kit24
  • Everything58
  • Docs
  • Pro
  • Account
Get Swift Pieces ProFree library ↗
Swift PiecesPro

Production-ready SwiftUI screens and app templates for iOS. The pieces to build the whole app.

Library

  • Screens
  • Templates
  • Build Kit
  • Everything

Product

  • Pro
  • Your account
  • Sign in

Resources

  • Docs
  • CLI
  • MCP and agents
  • Free library

Social

  • X / Twitter
  • GitHub

SWIFTPIECES PRO

© 2026 Swift Pieces. One payment, lifetime access, per-developer commercial license.

Curated withby Saivion

LibraryScreensPurchase

Screen · Commerce

Purchase

A complete StoreKit 2 purchase: plans load, the purchase runs, success lands, the app unlocks.

A complete StoreKit 2 paywall: loading skeleton, intro offers, purchase, restore, a transaction listener, a designed error state and a success moment before unlock.

SwiftUIiOS 17.0+glass-paywall-screen

Get Swift Pieces 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.

  • StoreKit 2 products, intro offers, purchase and restore
  • A transaction listener
  • A designed error state
  • A success moment before unlock
  • Built on the Paywall screen

Includes

Paywall. Installed together, automatically.

Requires

In-App Purchase capability

In the Build Kit

Subscription Utility (brief), Onboarding to Paywall (recipe). Your agent builds around this screen in the same design.

Used in

Subscription App (template), Meditation App (template), Travel App (template), Sleep App (template), Smart Home App (template), Weather App (template), Meal Planner (template)

02

Implementation notes

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

Loads products with Product.products(for:), maps them to PaywallPlan including eligible free-trial intro offers, purchases with verification, restores with AppStore.sync() and Transaction.currentEntitlements, and keeps a Transaction.updates listener running so Ask to Buy, renewals and purchases on other devices are finished and unlock the app. While loading, the Paywall screen shows skeleton cards; a load failure shows a designed retry card; purchase failures surface inline through PaywallStatus. A verified unlock plays a brief ring-and-check moment before onUnlocked fires.

Notes

  • PaywallModel is an @Observable @MainActor class you can drive from tests without the view.
  • Pass onDismiss when the screen is embedded (for example inside OnboardingFlowScreen) rather than presented.
  • GlassPaywallScreenExample at the end of GlassPaywallScreen.swift is the screen shown in the preview; copy it as a starting point.

Theming

  • Reads SPTheme from @Environment(\.spTheme) and requires the design-system item. The theme flows into GlassPaywallBlock through the environment, so one assignment styles both.
  • The background runs from accent at 45% to bg. The hero tile, close button and load-error card use spGlass, which turns opaque surfaceElevated under Reduce Transparency.
  • The success moment draws its ring and check in accent; "Try again" uses accent with accentOn text.

Requirements

  • In-App Purchase capability.
  • Products in App Store Connect matching productIDs.

03

Keep building

Pieces that work well next to this one.

Screen · Onboarding

Onboarding

First run end to end: welcome pages, a permission step and a trial offer, then into the app.

Screen · Commerce

Paywall

A paywall with plan cards, trial lines and every loading, purchasing and error state.

Screen · Finance

Send Money

A transfer review with the recipient, a huge amount and a slide-to-send control that commits with a haptic.