Class

NSFilePromiseReceiver

An object that receives a file promise from the pasteboard.

Declaration

class NSFilePromiseReceiver : NSObject

Overview

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.
}

Topics

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.

Relationships

Inherits From

See Also

File Promises

Supporting Drag and Drop Through File Promises

Receive and provide file promises to support dragged app files and pasteboard operations.

Supporting Table View Drag and Drop Through File Promises

Share data between macOS apps during drag and drop by using an item provider.

Supporting Collection View Drag and Drop Through File Promises

Share data between macOS apps during drag and drop by using an item provider.

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.