---
title: takeRetainedValue()
framework: swift
role: symbol
role_heading: Instance Method
path: swift/unmanaged/takeretainedvalue()
---

# takeRetainedValue()

Gets the value of this unmanaged reference as a managed reference and consumes an unbalanced retain of it.

## Declaration

```swift
func takeRetainedValue() -> Instance
```

## Return Value

Return Value The object referenced by this Unmanaged instance.

## Discussion

Discussion This is useful when a function returns an unmanaged reference and you know that you’re responsible for releasing the result.
