How do I build a workout app on iPhone?

Asked on 2024-07-30

1 search

To build a workout app on iPhone, particularly focusing on custom swimming workouts, you can leverage the capabilities of WorkoutKit. Here are the steps and features you can use:

  1. Create Different Types of Workouts: WorkoutKit allows you to create various types of workouts such as goal-based workouts, pacer workouts, triathlon workouts, and custom workouts. Custom workouts can include structured steps with custom goals and alerts.

  2. Structure of Custom Workouts: Custom workouts are composed of steps that conform to warm-up, work, recovery, or cool-down types. Work and recovery steps can be grouped into repeatable interval blocks.

  3. Custom Pool Swimming Workouts: For swimming workouts, you can specify the activity as swimming, add a display name, and pool all steps together. You can use the workout scheduler API to schedule the workout.

  4. New Features in watchOS 11:

    • Distance with Time Goal: This new goal type allows a workout step to have both a distance goal and a time goal.
    • Custom Step Names: You can customize the names of your work, recovery, warm-up, and cool-down steps using the new display name property.
  5. Example of Building a Custom Swimming Workout:

    • Create a distance with time goal, e.g., 225 meters in 1 minute.
    • Customize the step name to indicate the swim stroke.
    • Add the step to an interval block with repeats.
    • Create warm-up and cool-down steps.
    • Use the workout scheduler API to schedule the workout.

For more detailed guidance, you can refer to the session Build custom swimming workouts with WorkoutKit.

Relevant Sessions

  1. Build custom swimming workouts with WorkoutKit
  2. What’s new in watchOS 11

These sessions provide comprehensive information on how to utilize WorkoutKit for building custom workouts and the new features available in watchOS 11.