Type Method

readableTypes(for:)

Returns an array of UTI strings of data types the receiver can read from the pasteboard and be initialized from.

Required.

Declaration

static func readableTypes(for pasteboard: NSPasteboard) -> [NSPasteboard.PasteboardType]

Parameters

pasteboard

A pasteboard.

You can use the pasteboard argument to provide different types based on the pasteboard name, should you need to do so.

Return Value

An array of UTI strings of data types instances of the receiver can read from the pasteboard and be initialized from.

Discussion

By default, the data for a type is provided to init(pasteboardPropertyList:ofType:) as an instance of NSData. If you implement readingOptions(forType:pasteboard:) and specify a different option, the NSData object for a type can be converted to an NSString object or any other property list object.

Special Considerations

Do not perform other pasteboard operations in the method implementation.

See Also

Reading From the Pasteboard

struct NSPasteboard.ReadingOptions

Options to specify how data on the pasteboard should be interpreted to initialize pasteboard data.