StructureFoundationEssentials
Locale.Components
iOS 16.0+
iPadOS 16.0+
Mac Catalyst 16.0+
macOS 13.0+
tvOS 16.0+
watchOS 9.0+
A type that represents the components of a locale, for use when creating a locale with specific overrides.
struct Components
Topics
Initializers
init(from: any Decoder) throwsinit(identifier: String)Creates a locale components instance with the specified identifier.init(languageCode: Locale.LanguageCode?, script: Locale.Script?, languageRegion: Locale.Region?)Creates aLocale.Componentswith the specified language code, script and region for the languageinit(locale: Locale)Creates aLocale.Componentswith the identifier of the specifiedlocale.
Instance Properties
var calendar: Calendar.Identifier?Set this to override the default calendar. To request the default calendar used by the locale, useLocale.calendarvar collation: Locale.Collation?Set this to override the string sort order. To request the default calendar used by the locale, useLocale.calendarvar currency: Locale.Currency?Set this to override the currency. To request the default currency used by the locale, useLocale.currencyvar firstDayOfWeek: Locale.Weekday?Set this to override the first day of the week. To request the default first day of the week preferred by the locale, useLocale.firstDayOfWeekvar hourCycle: Locale.HourCycle?Set this to override the hour cycle. To request the default hour cycle, useLocale.hourCyclevar languageComponents: Locale.Language.ComponentsRepresents the language identifier a localevar measurementSystem: Locale.MeasurementSystem?Set this to override the measurement system. To request the default measurement system, useLocale.measurementSystemvar numberingSystem: Locale.NumberingSystem?Set this to override the numbering system. To request the default numbering system used by the locale, useLocale.numberingSystemvar region: Locale.Region?The region used by the locale.var subdivision: Locale.Subdivision?Set this to override the regional subdivision ofregionvar timeZone: TimeZone?Set this to specify a time zone to associate with this localevar variant: Locale.Variant?Set this to specify a variant used for the locale
Relationships
Conforms To
Swift.DecodableSwift.EncodableSwift.EquatableSwift.HashableSwift.SendableSwift.SendableMetatype