Initializer

init(_:destination:tag:selection:)

Creates a navigation link that presents a destination view when a bound selection variable matches a value you provide, using a text label that the link generates from a localized string key.

Declaration 宣言

init<V>(_ titleKey: LocalizedStringKey, destination: Destination, tag: V, selection: Binding<V?>) where V : Hashable
Available when Label is Text and Destination conforms to View.

Parameters パラメータ

titleKey

A localized string key for creating a text label.

destination

A view for the navigation link to present.

tag

The value of selection that causes the link to present destination.

selection

A bound variable that causes the link to present destination when selection becomes equal to tag.

See Also 参照

Deprecated Initializers