Template · Health

New

Fitness App

Pulse, a training app with rhythm: a complete Xcode project with a weekly plan, full-screen interval sessions, progress, widgets and three brand presets.

A training app on four tabs. First run asks what you train for, how much you train, the days you train and how long you have, then draws your week before a StoreKit 2 paywall. Today shows the week as its sessions and the day's session as a block you start; Start runs it full screen in the color of each phase and ends on a summary you rate; Timer builds your own intervals; Progress charts your load, personal bests and training split; Profile holds your streak, training days, sounds, haptics, the subscription and sign out.

SwiftUIiOS 17.0+Xcode project 1.0.0fitness-app

Get Swift Pieces Pro

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

01

What's inside

The screens this template wires together, in the order someone meets them.

02

What's included

SwiftUI source you own, built on Apple frameworks only.

  • A weekly plan drawn as its sessions, with the day's session as its rhythm
  • Every session full screen in the color of each phase, with haptics and count-in tones
  • A summary you rate, with top sets that become personal bests
  • A load curve you scrub, personal bests and your training split
  • An eight-week program fitted to your days and session length
  • Today and Week widgets
  • Three presets: Pearl, Neon and Graphic

Includes

Plan, Intervals, Progress, Settings, Purchase, Paywall. Installed together, automatically.

Requires

In-App Purchase capability

In the Build Kit

Health and Fitness (brief). Your agent builds around this template in the same design.

03

Implementation notes

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

FitnessApp is one root view. On first launch it runs Pulse's own first run: a welcome where one session's rhythm strip rises like a pulse, what you train for picked from four cover-art blocks, how much you train on rows of level bars, your training days and session length, your week drawn capsule by capsule, 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.

The home is SwiftUI's own TabView with four tabs and no search: Today, Timer, Progress and Profile. Today is the Plan screen: the program and your week in it as seven capsules sized by minutes, the day's session as a block with its rhythm strip and Start, and the moves on a numbered rail. Start runs the session on the Intervals screen's full-screen session, every set a work phase filling the screen in the session's color and every rest in its own, with haptics and optional count-in tones. It ends on a summary: the time, moves and estimated energy as light numerals and a ten-step track for how hard it was. Save fills the day's capsule and feeds Progress and the streak. Timer is the Intervals builder with your edits kept. Progress is the Progress screen: the last seven days, thirty days or year as totals, a load curve you scrub, personal bests and where the time went. Profile puts your week in the program and the streak over Settings, with start over back 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.
  • Your program: the sessions, their moves and the weekly order come from PulseSample at the top of FitnessApp.swift. A TrainingSession is moves with sets, work and rest, and it becomes the interval plan it runs, so a new program needs no timer code. PulseModel.session(on:) decides which session falls on which day.
  • History: PulseModel keeps finished sessions as PulseLog in memory and draws the week, the streak and the three periods from them. Persist the logs, and write each session to HealthKit in record(_:run:effort:).
  • Personal bests: PulseSample.bests are fixed. Log top sets on the summary to work out your own.
  • Plus: saving an edited interval format and the year on Progress open the paywall until Plus is unlocked; move or remove those gates in PulseHome.
  • Theme: everything follows the theme you set on FitnessApp. Without a brand it wears Pulse Pearl; SPBrandTheme(.pulseNeon) or .pulseGraphic re-skin every tab, including the session's fields, the heat behind the numerals and the cover art.

The Xcode project

The download is a complete project on Tuist: SwiftData history behind a repository protocol; Groundwork, an eight-week program in four phases with sixteen sessions and forty-five moves, fitted to the days and length you choose; six weeks of sample training with personal bests; top sets on the summary that become new bests; saved interval formats; training-day reminders; an Apple Health switch to connect; the Neon and Graphic themes with Pulse Plus; Today and Week widgets with pulse:// links; three presets; unit tests for the interval clock, sessions, the training math and the store, and a first-run UI test.

Notes

  • Not @main: put FitnessApp() in your own WindowGroup.
  • Enable the In-App Purchase capability before testing purchases. Writing workouts to Apple Health needs the HealthKit capability and usage strings.
  • Training weeks run Monday to Sunday, like the program, whatever the region's first weekday.
  • Energy is an estimate from time, work and effort, for motivation rather than measurement. Pulse's program is sample content for general fitness, not medical advice.
  • Previews ship with the file: first run, home, and home in each Pulse preset.