Contents

dragImageForSelection(with:origin:)

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

Declaration

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

Parameters

  • event:

    The event that initiated the drag session.

  • origin:

    On return, the lower-left point of the image in view coordinates.

Return Value

An appropriate drag image for the drag initiated by event. May be nil, in which case a default icon will be used.

Discussion

This method is used by dragSelection(with:offset:slideBack:). It can be called by others who need such an image, or can be overridden by subclasses to return a different image.

See Also

Dragging