One Logo Pool Ball
Foundation · IOS API REFERENCE

Locale.Collation

struct · iOS 16.0+ · SDK 27.1

struct Collation

A type that represents the string sort order used by the locale.

Members (9)

get · iOS 16.0+

identifier

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

The collation's BCP 47 identifier.

set · iOS 16.0+

identifier

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

The collation's BCP 47 identifier.

get · iOS 16.0+

searchRules

TypeScript
static get searchRules(): Locale_Collation
Swift declaration
static let searchRules: Locale.Collation

A collation used for string search. Use this collation only for determining whether to consider two strings as equivalent. Using this collation may modify the string for search purposes. For example, this collation suppresses the contractions in Thai and Lao. Don't use this collation to determine the relative order of two strings.

init · iOS 16.0+

init

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

Creates a collation from a BCP 47 identifier as a string literal. - Parameter value: The BCP 47 collation identifier, like `standard` for a language's standard ordering, or `phonetic` for phonetic ordering.

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.

static · iOS 16.0+

availableCollations

TypeScript
static availableCollationsFor(language: Locale_Language): Array<Locale_Collation>
Swift declaration
static func availableCollations(for language: Locale.Language) -> [Locale.Collation]

A list of available collations for the specified `language` in the order that it is most likely to make a difference.

get · iOS 16.0+

availableCollations

TypeScript
static get availableCollations(): Array<Locale_Collation>
Swift declaration
static var availableCollations: [Locale.Collation] { get }

A list of available collations on the system.

get · iOS 16.0+

standard

TypeScript
static get standard(): Locale_Collation
Swift declaration
static let standard: Locale.Collation

A collation that provides the default ordering for each language.

init · iOS 16.0+

init

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

Creates a collation from a BCP 47 identifier. - Parameter identifier: The BCP 47 collation identifier, like `standard` for a language's standard ordering, or `phonetic` for phonetic ordering. The complete list of collation identifiers can be found [here](https://github.com/unicode-org/cldr/blob/latest/common/bcp47/collation.xml), under the key named "co".

Skipped declarations

No declarations were skipped in this snapshot.

All Foundation types →