---
title: workoutSessionMirroringStartHandler
framework: healthkit
role: symbol
role_heading: Instance Property
path: healthkit/hkhealthstore/workoutsessionmirroringstarthandler
---

# workoutSessionMirroringStartHandler

A block that the system calls when it starts a mirrored workout session.

## Declaration

```swift
var workoutSessionMirroringStartHandler: (@Sendable (HKWorkoutSession) -> Void)? { get set }
```

## Discussion

Discussion The system calls this block on the companion iPhone when someone starts a mirrored workout on Apple Watch. If your iOS app isn’t active, the system launches it in the background. // The HealthKit store calls this closure when Apple Watch starts a remote session. store.workoutSessionMirroringStartHandler = { mirroredSession in     // Reset the health data.     self.data = HealthData()

// Save a reference to the workout session.     self.session = mirroredSession     logger.debug("*** A session started on the companion Apple Watch. ***") } To ensure that your app can always catch incoming mirrored workout sessions, assign this property as soon as your app launches. important: Your app may receive multiple calls to workoutSessionMirroringStartHandler. If iPhone and Apple Watch lose their connection in the middle of a workout session, Apple Watch automatically tries to reconnect. Each call has its own HKWorkoutSession instance. The system calls this block from an arbitrary background queue.

## See Also

### Managing workout sessions

- [startWatchApp(with:completion:)](healthkit/hkhealthstore/startwatchapp(with:completion:).md)
- [pause(_:)](healthkit/hkhealthstore/pause(_:).md)
- [resumeWorkoutSession(_:)](healthkit/hkhealthstore/resumeworkoutsession(_:).md)
