<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWindow/registerForDraggedTypes(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWindow(im)registerForDraggedTypes:"
  },
  "title" : "registerForDraggedTypes(_:)"
}
-->

# registerForDraggedTypes(_:)

Registers a set of pasteboard types that the window accepts as the destination of an image-dragging session.

```
func registerForDraggedTypes(_ newTypes: [NSPasteboard.PasteboardType])
```

## Parameters

`newTypes`

An array of the pasteboard types the window accepts as the destination of an image-dragging session.

## Discussion

Registering an `NSWindow` object for dragged types automatically makes it a candidate destination object for a dragging session. `NSWindow` has a default implementation for many of the methods in the [`NSDraggingDestination`](/documentation/AppKit/NSDraggingDestination) protocol. The default implementation forwards each message to the delegate if the delegate responds to the selector of the message. The messages forwarded this way are [`draggingEntered(_:)`](/documentation/AppKit/NSDraggingDestination/draggingEntered(_:)), [`draggingUpdated(_:)`](/documentation/AppKit/NSDraggingDestination/draggingUpdated(_:)), [`draggingExited(_:)`](/documentation/AppKit/NSDraggingDestination/draggingExited(_:)), [`prepareForDragOperation(_:)`](/documentation/AppKit/NSDraggingDestination/prepareForDragOperation(_:)), [`performDragOperation(_:)`](/documentation/AppKit/NSDraggingDestination/performDragOperation(_:)), and [`concludeDragOperation(_:)`](/documentation/AppKit/NSDraggingDestination/concludeDragOperation(_:)).

---

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)