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

# init(key:)

Initializes and returns a dragging image component with the specified key.

```
init(key: NSDraggingItem.ImageComponentKey)
```

## Parameters

`key`

The key.

## Return Value

An initialized dragging image component with the specified key.

## Discussion

This method is the designated initializer.

## See Also

[Drag and Drop](/documentation/AppKit/drag-and-drop)

Support the direct manipulation of your app’s content using drag and drop.



---

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)