Initializer

init(_:tag:selection:destination:)

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 title string.

Declaration 宣言

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

Parameters パラメータ

title

A string for creating a text label.

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.

destination

A view for the navigation link to present.

See Also 参照

Presenting a Selectable Destination View