---
title: sortDescriptors
framework: healthkit
role: symbol
role_heading: Instance Property
path: healthkit/hksamplequerydescriptor/sortdescriptors
---

# sortDescriptors

An array that specifies the order of the results that the query returns.

## Declaration

```swift
var sortDescriptors: [SortDescriptor<Sample>]
```

## Discussion

Discussion The system applies the sort descriptors in order. The later descriptors sort any items that the earlier sort descriptors considered equal. If you don’t need the results in a specific order, pass an empty array.

## See Also

### Accessing Query Properties

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