<!--
{
  "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/attachedMode(of:)-4qvrl",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Video"
    ],
    "preciseIdentifier" : "s:9CoreVideo21CVAttachmentContainerV12attachedMode2ofSo0cF0VSgs7KeyPathCyxmAA0cH10DefinitionVyqd__qd_0_GG_tAA0cF10PreferenceRd__AA0C18ValueRepresentableRd_0_r0_lF"
  },
  "title" : "attachedMode(of:)"
}
-->

# attachedMode(of:)

Returns the propagation mode of a stored attachment you identify with a key path to a key definition, without retrieving the value.

```
func attachedMode(of keyPath: KeyPath<Keys.Type, CVAttachmentKeyDefinition<some CVAttachmentModePreference, some CVAttachmentValueRepresentable>>) -> CVAttachmentMode?
```

## Parameters

`keyPath`

A key path to a key definition declared on the key definitions type.

## Return Value

The propagation mode of the attachment, or `nil` if the key isn’t attached.

## Discussion

Use this method to check for the presence of a specific key without converting its value.

The mode this method returns is the mode the attachment actually carries, which can differ from the preferred mode the key definition declares. Code that sets an attachment through the key’s raw value can ignore that preference.

---

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)