Contents

init(localized:)

Creates a localized attributed string from a localized string resource.

Declaration

init(localized resource: LocalizedStringResource)

Parameters

Discussion

Call this initializer to look up the localization indicated by resource. Alter the resource’s locale prior to calling this method if you want to localize this string in a different locale than the process that created the LocalizedStringResource.

The attributed string contains attributes of type AttributeScopes.FoundationAttributes.LocalizedStringArgumentAttributes to indicate runs containing formatted text, such as localized numbers or dates. Access these attributes with the attribute key localizedNumericArgument or localizedDateArgument.

See Also

Creating a Localized Attributed String