Contents

LPLinkView

A rich visual representation of a link.

Declaration

class LPLinkView

Overview

LPLinkView presents a link based on its available metadata. Use it to show a link’s title and icon, associated images, inline audio, video playback, and maps in a familiar and consistent style.

To present a rich link in your app, create an LPLinkView, passing an LPLinkMetadata instance into its initializer. Then add the LPLinkView to your view.

For example, to present links in a table view, add an LPLinkView instance as a subview when populating each cell.

let linkView = LPLinkView(metadata: metadata)
cell.contentView.addSubview(linkView)
linkView.sizeToFit()

LPLinkView has an intrinsic size, but it also responds to sizeToFit() to present a layout at any size.

Topics

Creating a link view

Specifying metadata

Initializers