A set of methods that defines the interface for initializing an object from a pasteboard.


protocol NSPasteboardReading


The Cocoa framework classes NSString, NSAttributedString, NSURL, NSColor, NSSound, NSImage, and NSPasteboardItem implement this protocol. You can make your custom class conform to this protocol so that you can read instances from a pasteboard using the readObjects(forClasses:options:) method of NSPasteboard.


Initializing the Pasteboard

init?(pasteboardPropertyList: Any, ofType: NSPasteboard.PasteboardType)

Initializes an instance with a property list object and a type string.


Reading From the Pasteboard

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

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


struct NSPasteboard.ReadingOptions

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

See Also


class NSPasteboard

An object that transfers data to and from the pasteboard server.

class NSPasteboardItem

An item on a pasteboard.

protocol NSPasteboardWriting

A set of methods that defines the interface for retrieving a representation of an object that can be written to a pasteboard.

protocol NSPasteboardItemDataProvider

A set of methods implemented by the data provider of a pasteboard item to provide the data for a particular UTI type.

struct NSPasteboard.ContentsOptions

Options for preparing the pasteboard.