Initializer

init(_:destination:)

Creates a control, consisting of a URL and a title key, used to navigate to a URL.

Declaration 宣言

init(_ titleKey: LocalizedStringKey, destination: URL)
Available when Label is Text. LabelTextである時に利用可能です。

Parameters パラメータ

titleKey

The key for the localized title that describes the purpose of this link.

destination

The URL for the link.

Discussion 議論

Use Link to create a control that your app uses to navigate to a URL that you provide. The example below creates a link to example.com and uses Visit Example Co as the title key to generate a link-styled view in your app:


Link("Visit Example Co",
      destination: URL(string: "https://www.example.com/")!)

See Also 参照

Creating a Link