Unmanaged
A type for propagating an unmanaged object reference.
@frozen struct Unmanaged<Instance> where Instance : AnyObject
When you use this type, you become partially responsible for keeping the object alive.
Citizens in Swift
Members
static func fromOpaque(UnsafeRawPointer
) -> Unmanaged<Instance> Unsafely turns an opaque C pointer into an unmanaged class reference.
static func passRetained(Instance
) -> Unmanaged<Instance> Creates an unmanaged reference with an unbalanced retain.
static func passUnretained(Instance
) -> Unmanaged<Instance> Creates an unmanaged reference without performing an unbalanced retain.
func release(
) Performs an unbalanced release of the object.
func retain(
) -> Unmanaged<Instance> Performs an unbalanced retain of the object.
func takeRetainedValue(
) -> Instance Gets the value of this unmanaged reference as a managed reference and consumes an unbalanced retain of it.
func takeUnretainedValue(
) -> Instance Gets the value of this unmanaged reference as a managed reference without consuming an unbalanced retain of it.
func toOpaque(
) -> UnsafeMutableRawPointer Unsafely converts an unmanaged class reference to a pointer.
Citizens in Swift
where Instance:Sendable
Conformances
protocol Sendable
A type whose values can safely be passed across concurrency domains by copying.
Extension in Atomics
Conformances
protocol AtomicOptionalWrappable
An atomic value that also supports atomic operations when wrapped in an
Optional
. Atomic optional wrappable types come with a standalone atomic representation for their optional-wrapped variants.protocol AtomicValue
A type that supports atomic operations through a separate atomic storage representation.