Skip to content

InitializerFoundationEssentials

init(locale:)

iOS 16.0+ iPadOS 16.0+ Mac Catalyst 16.0+ macOS 13.0+ tvOS 16.0+ watchOS 9.0+
Creates a Locale.Components with the identifier of the specified locale.
init(locale: Locale)

Parameters

locale

The locale whose identifier is used to create the component. If Locale.current or Locale.autoupdatingCurrent is specified, the created Locale.Components will contain user’s preferred values as set in the system settings if available.