<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ShareLink/init(_:items:subject:message:preview:)-7amxh",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI9ShareLinkVA2A07DefaultcD5LabelVRs1_rlE_5items7subject7message7previewACyxq_q0_AEGqd___xAA4TextVSgAmA0C7PreviewVyq_q0_G7ElementQzctcSyRd__lufc"
  },
  "title" : "init(_:items:subject:message:preview:)"
}
-->

# init(_:items:subject:message:preview:)

Creates an instance, with a custom label, that presents the share
interface.

```
nonisolated init<S>(_ title: S, items: Data, subject: Text? = nil, message: Text? = nil, preview: @escaping (Data.Element) -> SharePreview<PreviewImage, PreviewIcon>) where S : StringProtocol
```

## Parameters

`title`

The title of the share action.

`items`

The item to share.

`subject`

A title for the items to show when sharing to activities
that support a subject field.

`message`

A description of the items to show when sharing to
activities that support a message field. Activities may
support attributed text or HTML strings.

`preview`

A closure that returns a representation of each item to
render in a preview.

---

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)