UncheckedSendable

A generic wrapper for turning any non-Sendable type into a Sendable one, in an unchecked manner.

UncheckedSendable.swift:23
iOS
deprecated
macOS
deprecated
tvOS
deprecated
watchOS
deprecated
@dynamicMemberLookup @propertyWrapper struct UncheckedSendable<Value>

Sometimes we need to use types that should be sendable but have not yet been audited for sendability. If we feel confident that the type is truly sendable, and we don’t want to blanket disable concurrency warnings for a module via @preconcurrency import, then we can selectively make that single type sendable by wrapping it in UncheckedSendable.

To synchronously isolate a value with a lock, see LockIsolated.