<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "LinkPresentation",
  "identifier" : "/documentation/LinkPresentation/LPLinkView",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Link Presentation"
    ],
    "preciseIdentifier" : "c:objc(cs)LPLinkView"
  },
  "title" : "LPLinkView"
}
-->

# LPLinkView

A rich visual representation of a link.

```
class LPLinkView
```

## Overview

[`LPLinkView`](/documentation/LinkPresentation/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.

## Present a rich link

To present a rich link in your app, create an [`LPLinkView`](/documentation/LinkPresentation/LPLinkView), passing an
[`LPLinkMetadata`](/documentation/LinkPresentation/LPLinkMetadata) instance into its initializer. Then add the
[`LPLinkView`](/documentation/LinkPresentation/LPLinkView) to your view.

For example, to present links in a table view, add an [`LPLinkView`](/documentation/LinkPresentation/LPLinkView)
instance as a subview when populating each cell.

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

[`LPLinkView`](/documentation/LinkPresentation/LPLinkView) has an intrinsic size, but it also responds to
<doc://com.apple.documentation/documentation/UIKit/UIView/sizeToFit()>
to present a layout at any size.

## Topics

### Creating a link view

[`init(metadata:)`](/documentation/LinkPresentation/LPLinkView/init(metadata:))

Initializes a link view with specified metadata.

[`init(url:)`](/documentation/LinkPresentation/LPLinkView/init(url:)-6f6kt)

Initializes a placeholder link view without metadata for a given URL.

### Specifying metadata

[`metadata`](/documentation/LinkPresentation/LPLinkView/metadata)

The metadata from which to generate a rich presentation.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)