Contents

init(_:content:)

Creates a labeled view that generates its label from a localized string key.

Declaration

init(_ titleKey: LocalizedStringKey, @ViewBuilder content: () -> Content)

Parameters

  • titleKey:

    The key for the view’s localized title, that describes the purpose of the view.

  • content:

    The value content being labeled.

Discussion

This initializer creates a Text label on your behalf, and treats the localized key similar to init(_:tableName:bundle:comment:). See Text for more information about localizing strings.

See Also

Creating labeled content