A rich visual representation of a link.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
Framework
- Link
Presentation
Declaration
class LPLinkView : UIView
class LPLinkView : NSView
Overview
LPLink
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.
Present a Rich Link
To present a rich link in your app, create an LPLink
, passing an LPLink
instance into its initializer. Then add the LPLink
to your view.
For example, to present links in a table view, add an LPLink
instance as a subview when populating each cell.
let linkView = LPLinkView(metadata: metadata)
cell.contentView.addSubview(linkView)
linkView.sizeToFit()
LPLink
has an intrinsic size, but it also responds to size
to present a layout at any size.