<!--
{
  "availability" : [
    "iOS: 15.4.0 -",
    "iPadOS: 15.4.0 -",
    "macCatalyst: 15.4.0 -",
    "macOS: 13.0.0 -",
    "visionOS: -",
    "watchOS: 8.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKSampleQueryDescriptor/result(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "s:9HealthKit23HKSampleQueryDescriptorV6result3forSayxGSo13HKHealthStoreC_tYaKF"
  },
  "title" : "result(for:)"
}
-->

# result(for:)

Runs a one-shot query and asynchronously returns a snapshot of the current matching results.

```
func result(for healthStore: HKHealthStore) async throws -> [Sample]
```

## Parameters

`healthStore`

The access point for HealthKit data.

## Discussion

The adopting type’s [`Output`](/documentation/HealthKit/HKAsyncQuery/Output) associated type specifies the values that this method returns. For example, [`HKSampleQueryDescriptor`](/documentation/HealthKit/HKSampleQueryDescriptor) returns an array of [`HKQuantitySample`](/documentation/HealthKit/HKQuantitySample) objects.

```swift
let stepType = HKQuantityType(.stepCount)

let descriptor = HKSampleQueryDescriptor(
    predicates:[.quantitySample(type: stepType)],
    sortDescriptors: [SortDescriptor(\.endDate, order: .reverse)],
    limit: 10)

let results = try await descriptor.result(for: store)
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)