---
title: HKAttachmentStore
framework: healthkit
role: symbol
role_heading: Class
path: healthkit/hkattachmentstore
---

# HKAttachmentStore

The access point for attachments associated with samples in the HealthKit store.

## Declaration

```swift
class HKAttachmentStore
```

## Overview

Overview Use an HKAttachmentStore object to manage attachments for samples that your app has saved to the HealthKit store.

## Topics

### Creating an attachment store

- [init(healthStore:)](healthkit/hkattachmentstore/init(healthstore:).md)

### Adding attachments

- [addAttachment(to:name:contentType:url:metadata:)](healthkit/hkattachmentstore/addattachment(to:name:contenttype:url:metadata:).md)
- [addAttachment(to:name:contentType:url:metadata:completion:)](healthkit/hkattachmentstore/addattachment(to:name:contenttype:url:metadata:completion:).md)

### Accessing attachments

- [getAttachments(for:completion:)](healthkit/hkattachmentstore/getattachments(for:completion:).md)
- [dataReader(for:)](healthkit/hkattachmentstore/datareader(for:).md)
- [getData(for:completion:)](healthkit/hkattachmentstore/getdata(for:completion:).md)
- [streamData(for:dataHandler:)](healthkit/hkattachmentstore/streamdata(for:datahandler:).md)

### Removing attachments

- [removeAttachment(_:from:completion:)](healthkit/hkattachmentstore/removeattachment(_:from:completion:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Attachments

- [HKAttachment](healthkit/hkattachment.md)
- [HKAttachmentDataReader](healthkit/hkattachmentdatareader.md)
