Class

NSFilePromiseReceiver

An object that receives a file promise from the pasteboard.

Declaration

@interface NSFilePromiseReceiver : NSObject

Overview

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

NSArray<NSFilePromiseReceiver*> filePromises = [draggingPasteboard readObjectsForClasses:@[[NSFilePromiseReceiver class]] options:nil];

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

[draggingInfo enumerateDraggingItemsWithOptions:0 forView:view classes:@[[NSFilePromiseReceiver class]] searchOptions:@{} usingBlock:^(NSDraggingItem* draggingItem, NSInteger idx, BOOL* stop) {
    NSFilePromiseReceiver* filePromiseReceiver = draggingItem.item
    // Use filePromiseReceiver here for your task.
}];

Topics

Instance Properties

fileNames

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

fileTypes

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

Instance Methods

- receivePromisedFilesAtDestination:options:operationQueue:reader:

Fulfills the promises at the specified destination.

Type Properties

readableDraggedTypes

An array containing dragged file types that are readable.

Relationships

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.

NSFilePromiseProvider

An object that provides a promise for the pasteboard.

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.