---
title: "subscript(dynamicMember:)"
framework: corevideo
role: symbol
role_heading: Instance Subscript
path: "corevideo/cvattachmentaccess/subscript(dynamicmember:)-9egcs"
---

# subscript(dynamicMember:)

Get or set attachment value as a property of this object.

## Declaration

```swift
subscript<ModePreference, Value>(dynamicMember keyPath: KeyPath<Keys.Type, CVAttachmentKeyDefinition<ModePreference, Value>>) -> Value? where ModePreference : CVAttachmentModePreference, Value : CVAttachmentValueRepresentable { get set }
```

## Overview

Overview This subscript provides access to an attachment key as a property. The key to be accessed must be defined as a static property on the Keys type. extension CVPixelBufferAttachmentKeyDefinitions { 	static var pixelBufferNumber: Key<ShouldPropagate, Int> { 		"com.app.pixelBufferNumber" 	} }

func inspect(attachments: borrowing CVAttachmentAccess<CVPixelBufferAttachmentKeyDefinitions>) { 	let value: Int? = attachments.pixelBufferNumber }
