Instance Method

finishWorkout(completion:)

Creates the workout, using the samples and events added to the builder, and saves it to the HealthKit store.

Declaration

func finishWorkout(completion: @escaping (HKWorkout?, Error?) -> Void)

Discussion

You must call endCollection(withEnd:completion:) before calling this method.

See Also

Ending the Workout

func endCollection(withEnd: Date, completion: (Bool, Error?) -> Void)

Stops the collection of data, sets the workout’s end date, and deactivates the workout builder.

var endDate: Date?

The workout’s end date and time.

func discardWorkout()

Stops the collection of data and discards the current results without saving the workout.