The NSPasteboardWriting protocol specifies the interface for retrieving a representation of an object that can be written to 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 write instances of the class to a pasteboard using the writeObjects(_:) method of NSPasteboard.


Required Methods

func writableTypes(for: NSPasteboard)

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

func writingOptions(forType: String, pasteboard: NSPasteboard)

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

Property List for Type

func pasteboardPropertyList(forType: String)

Returns a property list object to represent the receiver on a pasteboard as an object of a specified type.


Pasteboard Writing Options

Constant to specify options for writing to a pasteboard, used by writingOptions(forType:pasteboard:).


Type to specify options for writing to a pasteboard.