<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.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/HKCategoryTypeIdentifier/sleepAnalysis",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:@HKCategoryTypeIdentifierSleepAnalysis"
  },
  "title" : "sleepAnalysis"
}
-->

# sleepAnalysis

A category sample type for sleep analysis information.

```
static let sleepAnalysis: HKCategoryTypeIdentifier
```

## Discussion

These samples use values from the [`HKCategoryValueSleepAnalysis`](/documentation/HealthKit/HKCategoryValueSleepAnalysis) enum.

For best results when analyzing sleep samples, it’s recommended that you use [`HKMetadataKeyTimeZone`](/documentation/HealthKit/HKMetadataKeyTimeZone) to store time zone metadata with your sleep sample data.

---

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)