<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKError/Code/errorUserExitedWorkoutSession",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:@E@HKErrorCode@HKErrorUserExitedWorkoutSession"
  },
  "title" : "HKError.Code.errorUserExitedWorkoutSession"
}
-->

# HKError.Code.errorUserExitedWorkoutSession

The user exited your application while a workout session was running.

```
case errorUserExitedWorkoutSession
```

## Discussion

Workout sessions end when the app goes into the background.

---

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)