Instance Method

endWorkoutSession:

Ends a workout session for the current app.

Declaration

- (void)endWorkoutSession:(HKWorkoutSession *)workoutSession;

Parameters

workoutSession

A currently running workout session. If the session is not running, the system returns an NSInvalidArgumentException exception.

Discussion

This method returns immediately; however, the work is performed asynchronously on an anonymous serial background queue. If successful, the session’s state transitions to HKWorkoutSessionStateEnded, and the system calls the session delegate’s workoutSession:didChangeToState:fromState:date: method.

See Also

Managing Workout Sessions

- startWatchAppWithWorkoutConfiguration:completion:

Launches or wakes the Watch app to create a new workout session.

- startWorkoutSession:

Starts a workout session for the current app.

Deprecated
- pauseWorkoutSession:

Pauses the provided workout session.

Deprecated
- resumeWorkoutSession:

Resumes the provided workout session.

Deprecated