Instance Method

registerForDraggedTypes:

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

Declaration

- (void)registerForDraggedTypes:(NSArray<NSPasteboardType> *)newTypes;

Parameters

newTypes

An array of Uniform Type Identifier. See System-Declared Uniform Type Identifiers for descriptions of the pasteboard type identifiers.

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

Unregisters the view as a possible destination in a dragging session.

registeredDraggedTypes

The array of pasteboard drag types that the view can accept.

- beginDraggingSessionWithItems:event:source:

Initiates a dragging session with a group of dragging items.

- dragFile:fromRect:slideBack:event:

Initiates a dragging operation from the view, allowing the user to drag a file icon to any application that has window or view objects that accept files.

Deprecated
- dragPromisedFilesOfTypes:fromRect:source:slideBack:event:

Initiates a dragging operation from the view, allowing the user to drag one or more promised files (or directories) into any application that has window or view objects that accept promised file data.

Deprecated
- shouldDelayWindowOrderingForEvent:

Allows the user to drag objects from the view without activating the app or moving the window of the view forward, possibly obscuring the destination.