---
title: HKElectrocardiogramType
framework: healthkit
role: symbol
role_heading: Class
path: healthkit/hkelectrocardiogramtype
---

# HKElectrocardiogramType

A type that identifies samples containing electrocardiogram data.

## Declaration

```swift
class HKElectrocardiogramType
```

## Overview

Overview The HKElectrocardiogramType class is a concrete subclass of the HKObjectType class. To create an electrocardiogram type instance, use the object type’s electrocardiogramType() convenience method. Use the electrocardiogram type to: Request permission to read electrocardiogram samples Query for electrocardiogram samples Electrocardiogram samples are read-only. You can request permission to read the samples using this identifier, but you can’t request authorization to share them. This means you can’t save new electrocardiogram samples to the HealthKit store. To add test data in iOS Simulator, open the Health app and select Browse > Heart > Electrocardiograms (ECG) > Add Data.

## 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

### Object type subclasses

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