readSelection(from:)
Reads data from the pasteboard and uses it to replace the current selection.
Declaration
optional func readSelection(from pboard: NSPasteboard) -> BoolParameters
- pboard:
The pasteboard containing the data to read.
Mentioned in
Return Value
true if your implementation was able to read the pasteboard data successfully; otherwise, false.
Discussion
You implement this method to replace your application’s current selection (that is, the text or objects that are currently selected) with the data on the pasteboard. The data would have been placed in the pasteboard by another application in response to a remote message from the Services menu. A readSelection(from:) message is sent to the same object that previously received a writeSelection(to:types:) message.
See Also
Related Documentation
- Services Implementation Guide