CVAttachmentKeyDefinitions
protocol · iOS 27.0+ · SDK 27.1
protocol CVAttachmentKeyDefinitionsMarks a type as a collection of attachment keys for an attachment bearer. The static properties of a type which implements this protocol provide definitions for the attachment keys. The static properties which have one of ``Key``, ``KeyWithDefault`` or ``CompositeKey`` type are used by an attachment access provider to get and set attachment values. For example, a custom attachment key for pixel buffers can be defined as: ```swift extension CVPixelBufferAttachmentKeyDefinitions { // This extension makes the key available as a property of `pixelBuffer.attachments`. static var customAttachment: Key<ShouldPropagate, CustomAttachmentValue> { .init("com.myapp.customAttachmentKey") } } // This extension facilitates conversion between CustomAttachmentValue and CVAttachmentRawValue extension CustomAttachmentValue: CVAttachmentValueRepresentable { static func makeFromRawAttachmentValue(_ repr: CVAttachmentRawValue) -> Self? { ... } var rawAttachmentValueRepresentation: CVAttachmentRawValue { ... } } ```
Members (0)
This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.
Skipped declarations
No declarations were skipped in this snapshot.