Protocol

HKWorkoutSessionDelegate

The session delegate protocol defines an interface for receiving notifications about errors and changes in the workout session’s state.

Declaration

@protocol HKWorkoutSessionDelegate

Overview

All the methods are required. HealthKit calls these methods on an anonymous serial background queue.

Topics

Tracking Workout Sessions

- workoutSession:didChangeToState:fromState:date:

Tells the delegate that the session’s state has changed.

Required.

- workoutSession:didFailWithError:

Tells the delegate that the session has failed with an error.

Required.

- workoutSession:didGenerateEvent:

Tells the delegate that the system has generated a workout event.

Relationships

Inherits From

See Also

Sessions

Running Workout Sessions

Track the user’s activities on Apple Watch.

HKWorkoutSession

A workout session that tracks the user’s workout on Apple Watch.

HKWorkoutSessionState

A workout session’s state.

HKWorkoutConfiguration

An object that contains configuration information about a workout session.