The NSPasteboardReading protocol specifies the interface for initializing an object from a pasteboard.


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: String)

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

Reading From the Pasteboard

static func readableTypes(for: NSPasteboard)

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

static func readingOptions(forType: String, pasteboard: NSPasteboard)

Returns options for reading data of a specified type from a given pasteboard.



Options to specify how data on the pasteboard should be interpreted to initialize an object in init(pasteboardPropertyList:ofType:).