Contents

readSelection(from:)

Reads the text view’s preferred type of data from the specified pasteboard.

Declaration

func readSelection(from pboard: NSPasteboard) -> Bool

Parameters

  • pboard:

    The pasteboard to read from.

Return Value

true if the data was successfully read, false otherwise.

Discussion

This method invokes the preferredPasteboardType(from:restrictedToTypesFrom:) method to determine the text view’s preferred type of data and then reads the data using the readSelection(from:type:) method.

You should not need to override this method. You might need to invoke this method if you are implementing a new type of pasteboard to handle services other than copy/paste or dragging.

See Also

Managing the pasteboard