Contents

init(item:subject:message:preview:label:)

Creates an instance that presents the share interface.

Declaration

nonisolated init<I>(item: I, subject: Text? = nil, message: Text? = nil, preview: SharePreview<PreviewImage, PreviewIcon>, @ViewBuilder label: () -> Label) where Data == CollectionOfOne<I>, I : Transferable

Parameters

  • item:

    The item to share.

  • subject:

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

  • message:

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

  • preview:

    A representation of the item to render in a preview.

  • label:

    A view builder that produces a label that describes the share action.

See Also

Sharing an item with a preview