---
title: "init(fromValue:)"
framework: healthkit
role: symbol
role_heading: Initializer
path: "healthkit/hkqueryanchor/init(fromvalue:)"
---

# init(fromValue:)

Returns an anchor object from the provided anchor value.

## Declaration

```swift
convenience init(fromValue value: Int)
```

## Parameters

- `value`: An anchor value.

## Return Value

Return Value An anchored object corresponding to the same sample as the anchor value.

## Discussion

Discussion Prior to iOS 9.0, anchored object queries used anchor values to track the last sample returned by a previous query. Use this method to convert those anchor values into anchor objects.

## See Also

### Related Documentation

- [init(type:predicate:anchor:limit:resultsHandler:)](healthkit/hkanchoredobjectquery/init(type:predicate:anchor:limit:resultshandler:).md)
- [init(type:predicate:anchor:limit:completionHandler:)](healthkit/hkanchoredobjectquery/init(type:predicate:anchor:limit:completionhandler:).md)
