Overview

A full-featured SwiftUI iOS starter with Supabase, RevenueCat, push notifications, and analytics wired in.

The Swift (iOS) template is a full-featured SwiftUI starter for iPhone and iPad. It ships with authentication, a Supabase backend, cross-platform subscriptions via RevenueCat, push notifications, deep links, analytics, crash reporting, and a full launch-gate stack (onboarding, legal consent, biometric lock, forced update) already wired together — so you build your product instead of the plumbing.

The core services above are wired end to end. A few surfaces are working Example features or a Removable demo meant to be replaced before you ship. The feature status table below is explicit about what is integrated and what you are expected to swap out.

Minimum iOS: 17.0. Targeted devices: iPhone + iPad. Built with Xcode 16+.

Graceful degradation

Every secret is optional. Missing keys don't crash the app — the owning controller flips to isConfigured = false and no-ops, so the project builds and boots with zero configuration. You wire services in one at a time as you need them. This is a headline behavior of the template; each service page notes exactly what happens when its key is absent. See Configuration.

Tech stack

LayerChoice
UISwiftUI (iOS 17+)
ArchitectureMVVM (@Observable view models) + Repository pattern
Dependency injectionAppEnvironment container via @Environment (no Swinject/Factory)
NavigationNavigationStack + Hashable route enums; TabView main shell
Backendsupabase-swift (Auth, PostgREST, Storage)
ConcurrencySwift Concurrency (async/await, AsyncStream), MainActor default isolation
Session storageiOS Keychain (via supabase-swift's KeychainLocalStorage)
App stateUserDefaults (AppPreferences wrapper)
Image loadingKingfisher (via a small RemoteImage wrapper)
SubscriptionsRevenueCat (purchases-ios)
PushAPNs via UNUserNotificationCenter + UIApplicationDelegateAdaptor
AnalyticsPostHog (posthog-ios)
Crash reportingSentry (sentry-cocoa)
BiometricLocalAuthentication (LAContext)
In-app reviewStoreKit requestReview(in:)
Deep linksUniversal Links + custom soar:// scheme
i18nLocalizable.xcstrings String Catalog (English + Simplified Chinese)

Feature status

Features are labelled consistently throughout these docs:

  • Integrated — fully wired; activates when its key or service is configured.
  • Example — a working demo feature meant to be replaced with your own.
  • Removable demo — the Showcase tab; delete it without touching core code.
  • Device-only — needs a physical device and a paid Apple Developer team.
FeatureStatusNotes
AuthenticationIntegratedEmail/password, sign-up + email OTP, forgot/reset, change email/password, sign out other sessions, delete account
Google Sign-InIntegratedNative SDK ID token → Supabase; needs GOOGLE_IOS_CLIENT_ID (tile is dimmed until set)
Apple Sign-InIntegratedASAuthorizationController → Supabase signInWithIdToken; needs the Sign in with Apple capability
SubscriptionsIntegratedRevenueCat paywall (monthly/yearly/lifetime); entitlement read from the shared Supabase subscriptions table
Push notificationsDevice-onlyAPNs registration only succeeds on a real device with a paid team
Deep linksIntegratedsoar:// scheme + Universal Links, routable to every major destination
AnalyticsIntegratedPostHog typed events, consent-gated start, identify/reset on auth changes
Crash reportingIntegratedSentry with user tagging, ErrorBoundary, user-feedback hook
Launch gatesIntegratedBiometric lock, forced/soft update, onboarding, legal consent
Store reviewIntegratedStoreKit smart trigger (action count + version + 90-day cooldown)
i18nIntegratedEnglish + Simplified Chinese, runtime language switch
ThemingIntegratedLight / Dark / System, persisted
Offline bannerIntegratedNetworkObserver (NWPathMonitor) mounted app-wide
Toast / hapticsIntegratedTop-of-screen toast overlay with success/error haptics
TodosExampleFull CRUD reference feature — copy its shape for your own data
Upload sampleExamplePhotosPicker → Supabase Storage with per-job progress
ProfileExampleAvatar, personal info, account & security screens
Refer a friendExampleShareLink + referral URL
ShowcaseRemovable demoCatalog of every capability; deletable in one step

App surface map

The app is composed as three layers, outside-in:

  • Gate stackRootView wraps everything in gates, evaluated in order: ErrorBoundary → Biometric → Update → Onboarding → Consent → Auth. Each gate blocks the layers below it until satisfied. See App Gates.
  • Auth stack — when there's no session, a small NavigationStack drives the login / sign-up / verify / forgot-password screens. See Authentication.
  • Main shell — once signed in, MainShellView mounts a TabView with four tabs (Home, Component, Showcase, Me) plus a side drawer. Each tab owns its own NavigationStack(path:) so back-stacks survive tab switches.

Cross-platform entitlement

Subscriptions are account-bound, not device-bound. A purchase flows through the RevenueCat webhook into a shared Supabase subscriptions read-model, and the app reads that table — not the RevenueCat SDK's CustomerInfo — as the source of truth. The same read-model is shared with the desktop template, so an entitlement bought on one platform is honored on the other. See Subscriptions.

Start here

Follow this path from clone to a shippable app:

On this page