---
title: "mostRecentQuantity(for:)"
framework: healthkit
role: symbol
role_heading: Instance Method
path: "healthkit/hkstatistics/mostrecentquantity(for:)"
---

# mostRecentQuantity(for:)

Returns the most recent value from all the samples that match the query and were created by the specified source.

## Declaration

```swift
func mostRecentQuantity(for source: HKSource) -> HKQuantity?
```

## See Also

### Related Documentation

- [discreteMostRecent](healthkit/hkstatisticsoptions/discretemostrecent.md)

### Getting the Most Recent Quantity

- [mostRecentQuantity()](healthkit/hkstatistics/mostrecentquantity().md)
- [mostRecentQuantityDateInterval()](healthkit/hkstatistics/mostrecentquantitydateinterval().md)
- [mostRecentQuantityDateInterval(for:)](healthkit/hkstatistics/mostrecentquantitydateinterval(for:).md)
