One Logo Pool Ball
Foundation · IOS API REFERENCE

Locale.MeasurementSystem

struct · iOS 16.0+ · SDK 27.1

struct MeasurementSystem

A type that represents the measurement system used by a locale, like metric or the US system.

Members (9)

get · iOS 16.0+

identifier

TypeScript
get identifier(): string
Swift declaration
var identifier: String { get set }

The measurement system's identifier.

set · iOS 16.0+

identifier

TypeScript
set identifier(value: string)
Swift declaration
var identifier: String { get set }

The measurement system's identifier.

init · iOS 16.0+

init

TypeScript
static initStringLiteral(value: string): Locale_MeasurementSystem
Swift declaration
init(stringLiteral value: String)

Creates a measurement system instance from a BCP 47 identifier as a string literal. - Parameter value: The measurement system's BCP 47 identifier, like `metric` or `ussystem`.

get · iOS 17.0+

debugDescription

TypeScript
get debugDescription(): string
Swift declaration
var debugDescription: String { get }

A textual representation of this instance, suitable for debugging. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(reflecting:)` initializer. This initializer works with any type, and uses the custom `debugDescription` property for types that conform to `CustomDebugStringConvertible`: struct Point: CustomDebugStringConvertible { let x: Int, y: Int var debugDescription: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(reflecting: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `debugDescription` property.

get · iOS 16.0+

measurementSystems

TypeScript
static get measurementSystems(): Array<Locale_MeasurementSystem>
Swift declaration
static var measurementSystems: [Locale.MeasurementSystem] { get }

An array containing all available measurement systems.

get · iOS 16.0+

uk

TypeScript
static get uk(): Locale_MeasurementSystem
Swift declaration
static let uk: Locale.MeasurementSystem

The UK system of measurement: feet, pints, etc.; pints are 20oz.

get · iOS 16.0+

us

TypeScript
static get us(): Locale_MeasurementSystem
Swift declaration
static let us: Locale.MeasurementSystem

The US system of measurement: feet, pints, etc.; pints are 16oz.

get · iOS 16.0+

metric

TypeScript
static get metric(): Locale_MeasurementSystem
Swift declaration
static let metric: Locale.MeasurementSystem

The metric system.

init · iOS 16.0+

init

TypeScript
static init(identifier: string): Locale_MeasurementSystem
Swift declaration
init(_ identifier: String)

Creates a measurement system from a BCP 47 identifier. The complete list of valid measurement systems can be found [here](https://github.com/unicode-org/cldr/blob/latest/common/bcp47/measure.xml), under the key with the name "ms".

Skipped declarations

No declarations were skipped in this snapshot.

All Foundation types →