Storing Data

A pasteboard can store one or more items at a time. Each pasteboard item is represented as a dictionary containing one or more key-value pairs that store the data and the associated type. A single pasteboard item might contain multiple entries to make it more likely that other apps can find a compatible data type. A UTI is commonly used to specify what kind of data is stored. For example, you might find public.text (and, more specifically, public.utf8-plain-text) to store text data, public.url for URL address, and public.jpeg for image data. These are among the many common data types used on iOS.

UIPasteboard provides methods to work with a single pasteboard item or multiple pasteboard items at a time, including investigating the ...

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.