Instance Method

writableTypesForPasteboard:

Returns an array of UTI strings of data types the receiver can write to a given pasteboard.

Required.

Declaration

- (NSArray<NSPasteboardType> *)writableTypesForPasteboard:(NSPasteboard *)pasteboard;

Parameters

pasteboard

A pasteboard.

You can use this argument to provide different options based on the pasteboard name, if you need to.

Return Value

An array of UTI strings of data types the receiver can write to pasteboard.

Discussion

By default, data for the first returned type is put onto the pasteboard immediately, with the remaining types being promised.

To change the default behavior, implement -writingOptionsForType:pasteboard: and return NSPasteboardWritingPromised to lazily provide data for types, return no option to provide the data for that type immediately. Use the pasteboard argument to provide different types based on the pasteboard name, if desired. Do not perform other pasteboard operations in the method implementation.

See Also

Required Methods

- writingOptionsForType:pasteboard:

Returns options for writing data of a specified type to a given pasteboard.

NSPasteboardWritingOptions

Type to specify options for writing to a pasteboard.