Protocol

HKWorkoutSessionDelegate

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

Overview

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

Topics

Tracking Workout Sessions

func workoutSession(HKWorkoutSession, didFailWithError: Error)

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

Required.

func workoutSession(HKWorkoutSession, didGenerate: HKWorkoutEvent)

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.

class HKWorkoutSession

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

enum HKWorkoutSessionState

A workout session’s state.

class HKWorkoutConfiguration

An object that contains configuration information about a workout session.