endCurrentActivity(on:)
Ends the current workout activity.
Declaration
func endCurrentActivity(on date: Date)Parameters
- date:
The end date and time for the activity.
Mentioned in
Discussion
This method asynchronously ends the current activity. HealthKit calls the session delegate’s workoutSession(_:didEndActivityWith:date:) method after the activity ends. HealthKit stops collecting data related to this activity.