Contents

init(_:selection:content:)

Creates a picker that generates its label from a localized string resource.

Declaration

@export(implementation) nonisolated init(_ titleResource: LocalizedStringResource, selection: Binding<SelectionValue>, @ContentBuilder content: () -> Content)

Parameters

  • titleResource:

    A localized string resource that describes the purpose of selecting an option.

  • selection:

    A binding to a property that determines the currently-selected option.

  • content:

    A view that contains the set of options.

Discussion

This initializer creates a Text view on your behalf. See Text for more information about localizing strings.

See Also

Creating a picker