Contents

readSelection(from:type:)

Reads data of the given type from the specified pasteboard.

Declaration

func readSelection(from pboard: NSPasteboard, type: NSPasteboard.PasteboardType) -> Bool

Parameters

  • pboard:

    The pasteboard to read from.

  • type:

    The type of data to read.

Return Value

true if the data was successfully read, false otherwise.

Discussion

The new data is placed at the current insertion point, replacing the current selection if one exists.

You should override this method to read pasteboard types other than the default types. Use the rangeForUserTextChange method to obtain the range of characters (if any) to be replaced by the new data.

See Also

Related Documentation

Managing the pasteboard