TechnologiesHealth & Fitness

WorkoutKit

iOSmacOStvOSwatchOSvisionOS

WorkoutKit builds and schedules custom workouts for Health and Fitness apps on iOS, macOS, and watchOS. You compose a CustomWorkout from IntervalBlock and IntervalStep values, or use prebuilt structures such as SingleGoalWorkout, PacerWorkout, and SwimBikeRunWorkout, setting targets with WorkoutGoal. Each step can carry alerts conforming to WorkoutAlert, including HeartRateRangeAlert, CadenceThresholdAlert, PowerZoneAlert, and SpeedRangeAlert, to cue the user on cadence, heart rate, power, and speed. Wrap a workout in a WorkoutPlan and use ScheduledWorkoutPlan with WorkoutScheduler to schedule it for delivery.

Custom Workouts 5

Compose a workout from interval blocks and steps, each with a goal.

  • St
    CustomWorkoutiOS 17.0+
    A structure that composes a workout from interval blocks and steps with targets.
  • St
    IntervalBlockiOS 17.0+
    A structure that groups repeated interval steps into a block of a workout.
  • St
    IntervalStepiOS 17.0+
    A structure that defines a single interval of work or recovery with a goal.
  • St
    WorkoutStepiOS 17.0+
    A structure that represents a single step within a workout with an optional goal and alert.
  • En
    WorkoutGoaliOS 17.0+
    Constants that specify a workout target, such as distance, time, energy, or open-ended.

Prebuilt Workout Structures 3

Ready-made workout templates for common training formats.

  • St
    SingleGoalWorkoutiOS 17.0+
    A prebuilt workout built around a single distance, time, or energy goal.
  • St
    PacerWorkoutiOS 17.0+
    A prebuilt workout that paces the user toward a goal over a set distance or time.
  • St
    SwimBikeRunWorkoutiOS 17.0+
    A prebuilt multisport workout combining swim, bike, and run segments.

Heart Rate, Cadence, and Power Alerts 11

Alerts that cue the user when a metric leaves a target range, threshold, or zone.

  • Pr
    WorkoutAlertiOS 17.0+
    A protocol for alerts that cue the user when a workout metric meets a defined condition.
  • St
    HeartRateRangeAlertiOS 17.0+
    An alert that cues the user when heart rate falls outside a target range.
  • St
    HeartRateZoneAlertiOS 17.0+
    An alert that cues the user when heart rate leaves a specified zone.
  • St
    CadenceRangeAlertiOS 17.0+
    An alert that cues the user when cadence falls outside a target range.
  • St
    CadenceThresholdAlertiOS 17.0+
    An alert that cues the user when cadence crosses a threshold value.
  • St
    PowerRangeAlertiOS 17.0+
    An alert that cues the user when power output falls outside a target range.
  • St
    PowerThresholdAlertiOS 17.0+
    An alert that cues the user when power output crosses a threshold value.
  • St
    PowerZoneAlertiOS 17.0+
    An alert that cues the user when power output leaves a specified zone.
  • St
    SpeedRangeAlertiOS 17.0+
    An alert that cues the user when speed falls outside a target range.
  • St
    SpeedThresholdAlertiOS 17.0+
    An alert that cues the user when speed crosses a threshold value.
  • En
    WorkoutAlertMetriciOS 17.0+
    Constants that identify the metric an alert monitors, such as heart rate, cadence, or power.

Plans and Scheduling 3

Wrap a workout in a plan and schedule it for delivery to the user's devices.

  • St
    WorkoutPlaniOS 17.0+
    A structure that wraps a workout for scheduling and delivery to the user.
  • St
    ScheduledWorkoutPlaniOS 17.0+
    A structure that pairs a workout plan with a date for scheduled delivery.
  • Cl
    WorkoutScheduleriOS 17.0+
    An object that schedules workout plans for delivery to the user's devices.

Errors 1

Errors reported when scheduling or workout state is invalid.

  • En
    StateErroriOS 17.0+
    Constants that describe errors arising from an invalid workout or scheduling state.

Extends 2

HKWorkoutView
← Health & Fitness