Contents

draggingSourceOperationMask

Information about the dragging operation and the data it contains.

Declaration

@MainActor var draggingSourceOperationMask: NSDragOperation { get }

Discussion

The dragging source (NSDraggingSource) declares the dragging operation mask through draggingSession(_:sourceOperationMaskFor:).

If the source doesn’t permit dragging operations, the value of the dragging source operation mask is NSDragOperationNone, or the empty option set in Swift ([]). If the source permits dragging operations, the value of the dragging source operation mask is the result of a bitwise OR operation on one or more of the NSDragOperation constants in Objective-C, or an option set containing one or more of the NSDragOperation constants in Swift.

If the user holds down a modifier key during the dragging session and the dragging source allows modifier keys to affect the drag operation, the system combines the dragging source operation mask with the value that corresponds to the modifier key. You control whether the modifier keys can affect the drag operation using the dragging source’s ignoreModifierKeys(for:) method.

Modifier Key

Dragging Operation

Option

Copy

Command

Move

Option and Command

Link

See Also

Obtaining information about the dragging session