Contents

performDrag(with:)

Starts a window drag based on the specified mouse-down event.

Declaration

func performDrag(with event: NSEvent)

Parameters

  • event:

    The original mouse-down event received by the application or a view.

Discussion

Your application (or a view) can call this method after receiving and examining a mouse-down event. Upon examination of the event, a view may allow that portion of the window to start a window drag and can hand off the work to the Window Server process by calling this method. Doing so allows the window to participate in space switching and other system features.

This method returns right away, and a mouse-up event may not get sent.

See Also

Handling Mouse Events