<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKWorkoutBuilder/updateActivity(uuid:end:completion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKWorkoutBuilder(im)updateActivityWithUUID:endDate:completion:"
  },
  "title" : "updateActivity(uuid:end:completion:)"
}
-->

# updateActivity(uuid:end:completion:)

Sets the end date for a workout activity that you’ve already added to the workout builder.

```
func updateActivity(uuid UUID: UUID, end endDate: Date, completion: @escaping @Sendable (Bool, (any Error)?) -> Void)
```

```
func updateActivity(uuid UUID: UUID, end endDate: Date) async throws
```

## Parameters

`UUID`

The workout activity’s universally unique identifier (UUID).

`endDate`

The end date and time for the workout activity.

`completion`

A callback handler that the system calls after updating the workout activity. The system calls the callback handler on an anonymous background queue.

    The callback handler takes the following parameters:

- success: Contains <doc://com.apple.documentation/documentation/Swift/true> if the builder successfully updates the activity.
- error: If the `success` parameter is <doc://com.apple.documentation/documentation/Swift/false>, this parameter contains information about the error; otherwise, it’s `nil`.

## Discussion

Calling this method after calling [`finishWorkout(completion:)`](/documentation/HealthKit/HKWorkoutBuilder/finishWorkout(completion:)) fails with an error.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)