An object that receives a file promise from the pasteboard.


class NSFilePromiseReceiver : NSObject


Because NSFilePromiseReceiver implements the NSPasteboardReading protocol, you receive all file promises on the drag pasteboard as follows:

let filePromises = draggingPasteboard.readObjects(forClasses: [NSFilePromiseReceiver.self], options: nil)

Likewise, you can enumerate dragged items by calling the following:

draggingInfo.enumerateDraggingItems(options: [], for: view, classes: [NSFilePromiseReceiver.self], searchOptions: [:], using: {(draggingItem, idx, stop) in
    let filePromiseReceiver = draggingItem.item
    // Use filePromiseReceiver here for your task.


Instance Properties

var fileNames: [String]

An array containing names of the promised files being written to the destination location.

var fileTypes: [String]

An array containing types of the promised files being written to the destination location.

Type Properties

class var readableDraggedTypes: [String]

An array containing dragged file types that are readable.


Inherits From

See Also

File Promises

Supporting Drag and Drop Through File Promises

Receive file promises to support dragged files from other apps and provide file promises to support pasteboard operations of your app’s custom file types.

class NSFilePromiseProvider

An object that provides a promise for the pasteboard.

protocol NSFilePromiseProviderDelegate

A set of methods that provides the name of the promised file and writes the file to the destination directory when the file promise is fulfilled.