---
title: limit
framework: healthkit
role: symbol
role_heading: Instance Property
path: healthkit/hksamplequery/limit
---

# limit

The maximum number of samples that this query returns.

## Declaration

```swift
var limit: Int { get }
```

## Discussion

Discussion This property’s value sets the maximum number of samples that the query returns upon completion. If you are specifically interested in retrieving only new samples (samples added since the last query), consider using an HKAnchoredObjectQuery query instead.

## See Also

### Getting Property Data

- [sortDescriptors](healthkit/hksamplequery/sortdescriptors.md)
