---
title: HKQueryAnchor
framework: healthkit
role: symbol
role_heading: Class
path: healthkit/hkqueryanchor
---

# HKQueryAnchor

An object used to identify all the samples previously returned by an anchored object query.

## Declaration

```swift
class HKQueryAnchor
```

## Overview

Overview The system returns HKQueryAnchor objects in both the anchored object query’s results handler and it’s update handler. Use the anchors to query for samples added or deleted after the result or update.

## Topics

### Creating Anchor Objects

- [init(fromValue:)](healthkit/hkqueryanchor/init(fromvalue:).md)

### Initializers

- [init(coder:)](healthkit/hkqueryanchor/init(coder:).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)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
