pathControl(_:shouldDrag:with:)
Implement this method to enable dragging from the control.
Declaration
@MainActor optional func pathControl(_ pathControl: NSPathControl, shouldDrag pathComponentCell: NSPathComponentCell, with pasteboard: NSPasteboard) -> BoolParameters
- pathControl:
The path control that sent the message.
- pathComponentCell:
The path component cell from which the drag is beginning.
- pasteboard:
The pasteboard.
Discussion
This method is called when a drag is about to begin. You can refuse to allow the drag to happen by returning false and allow it by returning true. By default, the pasteboard automatically has the following types on it: NSStringPboardType, NSURLPboardType (if there is a URL value for the cell being dragged), and NSFilenamesPboardType (if the URL value returns true from -isFileURL). You can customize the types placed on the pasteboard at this time, if desired. Implementation of this method is optional.