---
title: "correlationType(forIdentifier:)"
framework: healthkit
role: symbol
role_heading: Type Method
path: "healthkit/hkobjecttype/correlationtype(foridentifier:)"
---

# correlationType(forIdentifier:)

Returns the shared correlation type for the provided identifier.

## Declaration

```swift
class func correlationType(forIdentifier identifier: HKCorrelationTypeIdentifier) -> HKCorrelationType?
```

## Parameters

- `identifier`: A correlation type identifier. For a list of valid identifiers, see doc://com.apple.healthkit/documentation/HealthKit/HKCorrelationTypeIdentifier.

## Return Value

Return Value The shared HKCorrelationType instance based on the provided identifier.

## Discussion

Discussion This method returns an instance of the HKCorrelationType concrete subclass. HealthKit uses correlation types to create complex data objects that contain multiple values. Use correlation type instances to create correlation objects that you can save in the HealthKit store. For more information, see HKCorrelation.

## See Also

### Creating correlation types

- [HKCorrelationTypeIdentifier](healthkit/hkcorrelationtypeidentifier.md)
