<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreVideo",
  "identifier" : "/documentation/CoreVideo/CVAttachmentContainer/subscript(_:as:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Subscript",
  "symbol" : {
    "kind" : "Instance Subscript",
    "modules" : [
      "Core Video"
    ],
    "preciseIdentifier" : "s:9CoreVideo21CVAttachmentContainerV_2asqd__5value_So0C4ModeV4modetSgSS_qd__mtcAA0C18ValueRepresentableRd__luip"
  },
  "title" : "subscript(_:as:)"
}
-->

# subscript(_:as:)

Get or set attachment value associated with a string key

```
subscript<Value>(rawKey: String, as type: Value.Type = Value.self) -> (value: Value, mode: CVAttachmentMode)? where Value : CVAttachmentValueRepresentable { get set }
```

---

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)