---
title: "stopMirroringToCompanionDevice(completion:)"
framework: healthkit
role: symbol
role_heading: Instance Method
path: "healthkit/hkworkoutsession/stopmirroringtocompaniondevice(completion:)"
---

# stopMirroringToCompanionDevice(completion:)

Stops mirroring the workout session to the companion iOS device.

## Declaration

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

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

## Parameters

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

## Discussion

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:) method on the iOS companion’s session delegate. 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) ***") }

## See Also

### Working with remote workout sessions

- [startMirroringToCompanionDevice(completion:)](healthkit/hkworkoutsession/startmirroringtocompaniondevice(completion:).md)
- [sendToRemoteWorkoutSession(data:completion:)](healthkit/hkworkoutsession/sendtoremoteworkoutsession(data:completion:).md)
