---
title: "endCurrentActivity(on:)"
framework: healthkit
role: symbol
role_heading: Instance Method
path: "healthkit/hkworkoutsession/endcurrentactivity(on:)"
---

# endCurrentActivity(on:)

Ends the current workout activity.

## Declaration

```swift
func endCurrentActivity(on date: Date)
```

## Parameters

- `date`: The end date and time for the activity.

## Mentioned in

Dividing a HealthKit workout into activities

## Discussion

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.

## See Also

### Managing workout activities

- [currentActivity](healthkit/hkworkoutsession/currentactivity.md)
- [beginNewActivity(configuration:date:metadata:)](healthkit/hkworkoutsession/beginnewactivity(configuration:date:metadata:).md)
