Screen · Health

New

Plan

A training home where the week is drawn as its sessions and the day's session as its rhythm of work and rest.

The home tab of a training app: the program and where you are in it, the week as seven capsules as tall as each day's minutes (done days filled, planned ones outlined, a missed one dashed, rest days a dot, today breathing), and the chosen day's session as a block in its color with its minutes, moves and effort as light numerals, its sets as a rhythm strip of work and rest, and Start. Below it the moves run in order on a numbered rail; tap one for its cue. Tap a day and the block slides in from that side; rest days offer a recovery flow.

SwiftUIiOS 17.0+training-plan

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.

  • The week as seven capsules as tall as each day's minutes
  • The day's session as a block with its rhythm of work and rest
  • Tap a day and the session block slides in from that side
  • The moves in order on a numbered rail, with sets, rest and cues
  • Rest days with a recovery flow, plus loading and no-program states

Includes

Intervals. Installed together, automatically.

In the Build Kit

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

Used in

Fitness App (template)

02

Implementation notes

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

The week runs across the top as seven columns: the weekday and the date over a capsule as tall as that day's minutes against the week's longest. Days you trained fill their capsule with the session's block, days ahead are outlined in it, a missed one is a dashed outline, rest days are a single dot, and today's capsule breathes. Tap a day and its session block slides in from that day's side: the session's art in its block, the focus over the session's name, minutes, moves and effort as light numerals between hairlines, the whole session as a rhythm strip of sets and rests grouped by move, and Start. A day you already trained says Done with its minutes and keeps a quieter Again; a rest day turns calm and offers its recovery flow. In Pearl the haze glows low behind the block, warmer for a harder session. Below it the moves run in order on a numbered rail, each with its sets and rest and a short bar of its share of the session; tap one to open its cue in place.

Notes

  • Give TrainingPlan(program:days:) a TrainingProgramSummary (name, week, weeks, progress) and the week as [TrainingDay], each with its TrainingSession (or none on a rest day, with an optional recovery flow) and completedMinutes once done. onStart receives the day and the session for Start, Again and a recovery flow; session.intervalPlan runs it in IntervalSession with every set as a phase.
  • A TrainingSession is its moves in order. Each TrainingMove has sets, reps or a hold, the seconds a set takes on the clock, the rest between sets and a cue, and detail reads "3 × 12 · rest 45 s". steps, beats, minutes and share(of:) are worked out from them, so the capsule, the strip, the figures and the share bars always agree.
  • The selection is kept inside unless you pass selection; it starts on today. The block slides in from the side of the day you picked and the moves cross-fade, with a selection haptic.
  • States: phase: .loading draws the week and the block as breathing placeholders, a nil program shows a ghost week and a block that starts building one (onBuild), and a week with every session done says so in the header.
  • The week is one adjustable element for VoiceOver: swipe up or down through the days ("Tuesday, Press & Push, 34 minutes, done"). Moves are buttons whose value is their sets and, once open, their cue. The figures and Start read as text.
  • Reduce Motion turns the slide into a cross-fade, stops today's capsule breathing and keeps the haze still. Reduce Transparency leaves out the haze, so the moves sit on the plain ground.
  • TrainingPlan depends on the Intervals screen for RhythmStrip, IntervalPlan and IntervalField.
  • TrainingPlanExample at the end of TrainingPlan.swift is the screen in the preview, the Today tab of a native four-tab TabView, on week 3 of an eight-week program. Copy it as a starting point.