---
title: toOpaque()
framework: swift
role: symbol
role_heading: Instance Method
path: swift/unmanaged/toopaque()
---

# toOpaque()

Unsafely converts an unmanaged class reference to a pointer.

## Declaration

```swift
func toOpaque() -> UnsafeMutableRawPointer
```

## Return Value

Return Value An opaque pointer to the value of this unmanaged reference.

## Discussion

Discussion This operation does not change reference counts. let str0 = "boxcar" as CFString let bits = Unmanaged.passUnretained(str0) let ptr = bits.toOpaque()
