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

# attachedMode(of:)

Returns the propagation mode of an attachment you identify with a key path to a key definition that supplies a default, without retrieving the value.

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

## Parameters

`keyPath`

A key path to a key definition that supplies a default value.

## 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.

Because this kind of key supplies a default, reading it as a property always produces a value, whether or not the buffer carries an attachment for it. This method returns `nil` in the second case, which makes it the way to tell an attached value from a defaulted one.

---

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)