Instance Method

dragOperation(for:type:)

Returns the type of drag operation that should be performed if the image were released now.

Declaration

func dragOperation(for dragInfo: NSDraggingInfo, type: NSPasteboard.PasteboardType) -> NSDragOperation

Parameters

dragInfo

The drag information.

type

The pasteboard type that will be read from the dragging pasteboard.

Return Value

The drag operation that should be performed if the image were released now.

Discussion

The returned value should be one of the following:

Option

Meaning

NSDragOperationCopy

The data represented by the image will be copied.

NSDragOperationLink

The data will be shared.

NSDragOperationGeneric

The operation will be defined by the destination.

NSDragOperationPrivate

The operation is negotiated privately between the source and the destination.

If none of the operations is appropriate, this method should return NSDragOperationNone.

This method is called repeatedly from draggingEntered(_:) and draggingUpdated(_:) as the user drags the image.

See Also

Dragging

func dragImageForSelection(with: NSEvent, origin: NSPointPointer?) -> NSImage?

Returns an appropriate drag image for the drag initiated by the specified event.

var acceptsGlyphInfo: Bool

A Boolean value that indicates whether the receiver accepts the glyph info attribute.