---
title: "registerForDraggedTypes(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindow/registerfordraggedtypes(_:)"
---

# registerForDraggedTypes(_:)

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

## Declaration

```swift
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

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 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(_:), draggingUpdated(_:), draggingExited(_:), prepareForDragOperation(_:), performDragOperation(_:), and concludeDragOperation(_:).

## See Also

### Dragging Items

- [drag(_:at:offset:event:pasteboard:source:slideBack:)](appkit/nswindow/drag(_:at:offset:event:pasteboard:source:slideback:).md)
- [unregisterDraggedTypes()](appkit/nswindow/unregisterdraggedtypes().md)
