Instance Method

endCollection(withEnd:completion:)

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

Declaration

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

See Also

Ending the Workout

var endDate: Date?

The workout’s end date and time.

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

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

func discardWorkout()

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