Contents

init(stringInterpolation:)

Creates a localized string resource from the given string interpolation.

Declaration

init(stringInterpolation: String.LocalizationValue.StringInterpolation)

Parameters

  • stringInterpolation:

    The key to use when looking up a localized value, created from a string interpolation.

Discussion

To create a localized string key from a string interpolation, use the \() string interpolation syntax. Swift matches the parameter types in the expression to one of the appendInterpolation methods in LocalizedStringResource/StringInterpolation.

This initializer uses the default values from LocalizedStringResource/init(_:table:locale:bundle:comment:) for the table, locale, bundle, and comment.

See Also

Creating a localized string resource from literal values