An object that contains metadata about a URL.
- iOS 13.0+Beta
- macOS 10.15+Beta
LPLink to store the metadata about a URL, including its title, icon, images and video.
Fetch metadata using
LPMetadata. For remote URLs, cache the metadata locally to avoid the data and performance cost of fetching it from the internet every time you present it.
LPLink is serializable with
For local file URLs, the QuickLookThumbnailing API retrieves a representative thumbnail for the file, if possible.
Provide Custom Metadata
Say your app already has a database of links, with titles and images that weren’t fetched by
LPMetadata. You don’t have to fetch new metadata from the internet in order to accelerate the share sheet or to present a rich link. Instead, you can fill in the fields of
Accelerate the Share Sheet Preview
For existing apps that share URLs, the share sheet automatically presents a preview of the link. The preview first shows a placeholder link icon alongside the base URL while fetching the link’s metadata over the network. The preview updates once the link’s icon and title become available.
If you already have an
LPLink object for a URL, pass it to the share sheet to present the preview instantly, without fetching data over the network. In your implementation of
activity, return the metadata object.
If the user chooses to share to Messages, the same metadata passes directly through, providing a smooth and seamless experience with no unnecessary loading.