<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Unmanaged/fromOpaque(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s9UnmanagedV10fromOpaqueyAByxGSVFZ"
  },
  "title" : "fromOpaque(_:)"
}
-->

# fromOpaque(_:)

Unsafely turns an opaque C pointer into an unmanaged class reference.

```
static func fromOpaque(_ value: UnsafeRawPointer) -> Unmanaged<Instance>
```

## Parameters

`value`

An opaque C pointer.

## Return Value

An unmanaged class reference to `value`.

## Discussion

This operation does not change reference counts.

```
let str: CFString = Unmanaged.fromOpaque(ptr).takeUnretainedValue()
```

---

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)