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

# registerForDraggedTypes(_:)

Registers the pasteboard types that the view will accept as the destination of an image-dragging session.

## Declaration

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

## Parameters

- `newTypes`: An array of https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/UniformTypeIdentifier.html#//apple_ref/doc/uid/TP40008195-CH60. See https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html#//apple_ref/doc/uid/TP40009259 for descriptions of the pasteboard type identifiers.

## Discussion

Discussion Registering an NSView object for dragged types automatically makes it a candidate destination object for a dragging session. As such, it must properly implement some or all of the NSDraggingDestination protocol methods. As a convenience, NSView provides default implementations of these methods. See the NSDraggingDestination protocol specification for details.

## See Also

### Dragging Operations

- [unregisterDraggedTypes()](appkit/nsview/unregisterdraggedtypes().md)
- [registeredDraggedTypes](appkit/nsview/registereddraggedtypes.md)
- [beginDraggingSession(with:event:source:)](appkit/nsview/begindraggingsession(with:event:source:).md)
- [beginDraggingSession(items:gesture:source:)](appkit/nsview/begindraggingsession(items:gesture:source:).md)
- [shouldDelayWindowOrdering(for:)](appkit/nsview/shoulddelaywindowordering(for:).md)
