Retrieving Data
When using one of the four special classes listed previously, simply use the associated property to retrieve data from the pasteboard. Otherwise, you can fetch data using the dataForPasteboardType: method. This method returns the data from the first item in the pasteboard. Any other items in the pasteboard are ignored.
If you need to retrieve all matching data, recover an itemSetWithPasteboardTypes: and then iterate through the set to retrieve each dictionary. Recover the data type for each item from the single dictionary key and the data from its value.
Modified pasteboards issue a UIPasteboardChangedNotification, which you can listen to via a default NSNotificationCenter observer. You can also watch custom pasteboards and listen ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access