Drift, a sleep and recovery companion for a smart ring: a complete Xcode project with pairing, daily readiness, sleep stages, trends, widgets and three brand presets.
A sleep and recovery app on four tabs. First run pairs the ring on a turning dial, sets a bedtime goal and hands off to a StoreKit 2 paywall. Today pages through daily scores on a tilted card rail with a tick dial; Sleep reads last night's stages; Trends shows the weeks; Profile holds the ring, bedtime reminders, the subscription and sign out.
$199 once, every piece included. See how installing works · Sign in
The screens this template wires together, in the order someone meets them.
First run
Welcome, ring pairing on the dial, a bedtime goal, reminders and the StoreKit 2 paywall. Runs once, then records completion.
Tabs
Today, Sleep, Trends and Profile. Today is the Readiness rail; Sleep is the night's stage timeline.
SwiftUI source you own, built on Apple frameworks only.
How it behaves, what it handles, and the decisions behind it.
SleepApp is one root view. On first launch it runs Drift's own first run: a welcome with the ring drawn over the score card's arc, pairing the ring on the Readiness screen's tick dial (the ticks fill as it pairs), a bedtime goal you set by turning the same dial, then the Purchase screen's StoreKit 2 paywall. Closing, purchasing or restoring finishes onboarding and records it under a completion key, so the root switches to the home on its own.
There is no tab bar. Three round floating buttons carry the app: Sleep on the left, a capsule for Today and Trends in the middle, Profile on the right. Today is the Readiness screen: Sleep, Readiness, Recovery and Balance cards on a tilted rail, with the dial underneath turning through the last fourteen days. Sleep is the Sleep screen: last night as a stepped stage timeline you scrub, with stage totals as capsule bars. Trends stacks each night's stages into capsule columns and sets the share of nights on goal as a giant figure over a grid of dots. Profile is Settings, with sign out back to first run.
productIDs. Until they exist, the paywall shows its designed "plans didn't load" state and its close button still finishes onboarding.DriftSample at the top of SleepApp.swift. Map your ring SDK's or HealthKit's samples to [SleepSegment] per night and your scores to ReadinessDay.SleepAppPairStep.pair() simulates the ring. Call your SDK's discovery and bonding there and drive the dial's progress from it.SleepApp. Without a brand it wears Drift Frost; SPBrandTheme(.driftVelvet) or .driftGraphic re-skin every destination, including the cards, stage colours and motif.The download is a complete project on Tuist: SwiftData nights behind a repository protocol; sleep, recovery, balance and readiness scored against a seven-night baseline, with the contributors behind each; pairing with a designed failure and retry; a bedtime goal and wind-down reminders; loading, no data and error states on Sleep; Trends by week and month; Readiness and Last Night widgets; three presets; unit tests and a first-run UI test.
@main: put SleepApp() in your own WindowGroup.Pieces that work well next to this one.