<!--
{
  "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/HKCategoryType",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKCategoryType"
  },
  "title" : "HKCategoryType"
}
-->

# HKCategoryType

A type that identifies samples that contain a value from a small set of possible values.

```
class HKCategoryType
```

## Overview

The [`HKCategoryType`](/documentation/HealthKit/HKCategoryType) class is a concrete subclass of the HKObjectType class. To create a category type instance, use the [`init(_:)`](/documentation/HealthKit/HKCategoryType/init(_:)) convenience method.  For example, the following code creates a category sample type for handwashing events.

```swift
let handwashingCategoryType = HKCategoryType(.handwashingEvent)
```

Use category types to:

- Request permission to read or write matching category samples.
- Create and share matching category samples.
- Query for matching category samples.

For a complete list of category types, refer to [`HKCategoryTypeIdentifier`](/documentation/HealthKit/HKCategoryTypeIdentifier).

## Topics

### Creating Category Types

[`init(_:)`](/documentation/HealthKit/HKCategoryType/init(_:))

Creates a category type using the provided identifier.

## See Also

[`HKCategoryTypeIdentifier`](/documentation/HealthKit/HKCategoryTypeIdentifier)

Identifiers for creating category types.

[`HKCategorySample`](/documentation/HealthKit/HKCategorySample)

A sample with values from a short list of possible values.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Sendable`](/documentation/Swift/Sendable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`Hashable`](/documentation/Swift/Hashable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSCopying`](/documentation/Foundation/NSCopying)

### Inherits From

[`HKSampleType`](/documentation/HealthKit/HKSampleType)

---

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)