<!--
{
  "availability" : [
    "iOS: 8.0.0 - 27.0.0",
    "iPadOS: 8.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 - 27.0.0",
    "watchOS: 2.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKObjectType/categoryType(forIdentifier:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKObjectType(cm)categoryTypeForIdentifier:"
  },
  "title" : "categoryType(forIdentifier:)"
}
-->

# categoryType(forIdentifier:)

Returns the shared category type for the provided identifier.

```
class func categoryType(forIdentifier identifier: HKCategoryTypeIdentifier) -> HKCategoryType?
```

## Parameters

`identifier`

A category type identifier. For a list of valid identifiers, see [`HKCategoryTypeIdentifier`](/documentation/HealthKit/HKCategoryTypeIdentifier).

## Return Value

The shared `HKCategoryType` instance based on the provided identifier.

## Discussion

This method returns an instance of the [`HKCategoryType`](/documentation/HealthKit/HKCategoryType) concrete subclass. HealthKit uses category types to represent data that can be categorized into an enumeration of values. Use category type instances to create category samples that you can then save in the HealthKit store. For more information, see [`HKCategorySample`](/documentation/HealthKit/HKCategorySample).

---

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)