---
title: HKCategoryType
framework: healthkit
role: symbol
role_heading: Class
path: healthkit/hkcategorytype
---

# HKCategoryType

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

## Declaration

```swift
class HKCategoryType
```

## Mentioned in

Recording and querying menopausal state

## Overview

Overview The HKCategoryType class is a concrete subclass of the HKObjectType class. To create a category type instance, use the init(_:) convenience method.  For example, the following code creates a category sample type for handwashing events. 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.

## Topics

### Creating Category Types

- [init(_:)](healthkit/hkcategorytype/init(_:).md)

## Relationships

### Inherits From

- [HKSampleType](healthkit/hksampletype.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Related Documentation

- [HKCategoryTypeIdentifier](healthkit/hkcategorytypeidentifier.md)
- [HKCategorySample](healthkit/hkcategorysample.md)

### Object type subclasses

- [HKCharacteristicType](healthkit/hkcharacteristictype.md)
- [HKQuantityType](healthkit/hkquantitytype.md)
- [HKCorrelationType](healthkit/hkcorrelationtype.md)
- [HKActivitySummaryType](healthkit/hkactivitysummarytype.md)
- [HKAudiogramSampleType](healthkit/hkaudiogramsampletype.md)
- [HKElectrocardiogramType](healthkit/hkelectrocardiogramtype.md)
- [HKSeriesType](healthkit/hkseriestype.md)
- [HKClinicalType](healthkit/hkclinicaltype.md)
- [HKWorkoutType](healthkit/hkworkouttype.md)
- [HKObjectType](healthkit/hkobjecttype.md)
- [HKSampleType](healthkit/hksampletype.md)
