Contents

widgetURL(_:)

Sets the URL to open in the containing app when the user clicks the widget.

Declaration

@MainActor @preconcurrency func widgetURL(_ url: URL?) -> some View

Parameters

  • url:

    The URL to open in the containing app.

Return Value

A view that opens the specified URL when the user clicks the widget.

Discussion

Widgets support one widgetURL modifier in their view hierarchy. If multiple views have widgetURL modifiers, the behavior is undefined.

See Also

URLs