---
title: "CVBufferSetAttachments(_:_:_:)"
framework: corevideo
role: symbol
role_heading: Function
path: "corevideo/cvbuffersetattachments(_:_:_:)"
---

# CVBufferSetAttachments(_:_:_:)

Sets a dictionary of attachments on a Core Video buffer.

## Declaration

```swift
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 doc://com.apple.corevideo/documentation/CoreVideo/CVAttachmentMode for possible values. Any given attachment key may exist in only one mode at a time.

## Discussion

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

## See Also

### Working with attachments

- [CVBufferHasAttachment(_:_:)](corevideo/cvbufferhasattachment(_:_:).md)
- [CVBufferCopyAttachment(_:_:_:)](corevideo/cvbuffercopyattachment(_:_:_:).md)
- [CVBufferCopyAttachments(_:_:)](corevideo/cvbuffercopyattachments(_:_:).md)
- [CVBufferSetAttachment(_:_:_:_:)](corevideo/cvbuffersetattachment(_:_:_:_:).md)
- [CVBufferPropagateAttachments(_:_:)](corevideo/cvbufferpropagateattachments(_:_:).md)
- [CVBufferRemoveAttachment(_:_:)](corevideo/cvbufferremoveattachment(_:_:).md)
- [CVBufferRemoveAllAttachments(_:)](corevideo/cvbufferremoveallattachments(_:).md)
- [CVBufferGetAttachment(_:_:_:)](corevideo/cvbuffergetattachment(_:_:_:).md)
- [CVBufferGetAttachments(_:_:)](corevideo/cvbuffergetattachments(_:_:).md)
