---
title: anchor
framework: healthkit
role: symbol
role_heading: Instance Property
path: healthkit/hkanchoredobjectquerydescriptor/anchor
---

# anchor

An anchor that a previous anchored object query returned.

## Declaration

```swift
var anchor: HKQueryAnchor?
```

## Discussion

Discussion The anchor object corresponds to the last object that the previous query returned. The current query returns only samples and deleted objects newer than the anchor. Pass nil to receive all the matching samples and recently deleted objects currently in the HealthKit store.

## See Also

### Accessing Query Properties

- [predicates](healthkit/hkanchoredobjectquerydescriptor/predicates.md)
- [limit](healthkit/hkanchoredobjectquerydescriptor/limit.md)
