<!--
{
  "availability" : [
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKWorkoutSession/stopMirroringToCompanionDevice(completion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKWorkoutSession(im)stopMirroringToCompanionDeviceWithCompletion:"
  },
  "title" : "stopMirroringToCompanionDevice(completion:)"
}
-->

# stopMirroringToCompanionDevice(completion:)

Stops mirroring the workout session to the companion iOS device.

```
func stopMirroringToCompanionDevice(completion: @escaping @Sendable (Bool, (any Error)?) -> Void)
```

```
func stopMirroringToCompanionDevice() async throws
```

## Parameters

`completion`

A block that the system calls when the stop request is complete. The system sets the following parameters:

- `success`: A Boolean value that indicates whether the system successfully stopped mirroring the session.
- `error`: If `success` is <doc://com.apple.documentation/documentation/Swift/false>, this contains an object that describes the error. Otherwise, it’s `nil`.

## Discussion

Call this method in your watchOS app to stop the mirrored workout session on the companion iOS app. After the mirroring stops, the system calls the [`workoutSession(_:didDisconnectFromRemoteDeviceWithError:)`](/documentation/HealthKit/HKWorkoutSessionDelegate/workoutSession(_:didDisconnectFromRemoteDeviceWithError:)) method on the iOS companion’s session delegate.

```swift
session.end()

// Stop the workout builder and save the workout data.
do {
    try await builder.endCollection(at: Date())
    try await builder.finishWorkout()
} catch {
    // Handle the error here.
    fatalError("*** An error occurred while stoping the workout: \(error.localizedDescription) ***")
}

// Stop the mirrored workout on the iOS companion.
do {
    try await session.stopMirroringToCompanionDevice()
} catch {
    // Handle the error here.
    fatalError("*** An error occurred while stoping the mirrored workout: \(error.localizedDescription) ***")
}
```

---

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)