<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreVideo",
  "identifier" : "/documentation/CoreVideo/CVBufferSetAttachments(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Video"
    ],
    "preciseIdentifier" : "c:@F@CVBufferSetAttachments"
  },
  "title" : "CVBufferSetAttachments(_:_:_:)"
}
-->

# CVBufferSetAttachments(_:_:_:)

Sets a dictionary of attachments on a Core Video buffer.

```
func CVBufferSetAttachments(_ buffer: CVBuffer, _ theAttachments: CFDictionary, _ attachmentMode: CVAttachmentMode)
```

## Parameters

`buffer`

The buffer on which to set the attachments.

`theAttachments`

The dictionary of the attachments to set.

`attachmentMode`

The attachment mode for this attachment. See [`CVAttachmentMode`](/documentation/CoreVideo/CVAttachmentMode) for possible values. Any given attachment key may exist in only one mode at a time.

## Discussion

This is a convenience function that calls [`CVBufferSetAttachment(_:_:_:_:)`](/documentation/CoreVideo/CVBufferSetAttachment(_:_:_:_:)) for each key-value pair in the given dictionary. All key-value pairs must be in the root level of the dictionary.

---

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)