<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSDraggingImageComponent/key",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDraggingImageComponent(py)key"
  },
  "title" : "key"
}
-->

# key

The unique name of this image component instance.

```
var key: NSDraggingItem.ImageComponentKey { get set }
```

## Discussion

The key must be unique for each component in an [`NSDraggingItem`](/documentation/AppKit/NSDraggingItem) instance. You can create your own named components, however the keys described in [NSDragImage Component Keys](/documentation/AppKit/nsdragimage-component-keys) have special meanings.

When an NSDraggingItem instances [`imageComponents`](/documentation/AppKit/NSDraggingItem/imageComponents) are changed by one of the `enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:` methods the image associated with this key is morphed into the new image component’s image associated with the same key.

---

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)