Skip to content

Instance Property

collation

iOS 16.0+ iPadOS 16.0+ Mac Catalyst 16.0+ macOS 13.0+ tvOS 16.0+ watchOS 9.0+
The string sort order of the locale.
var collation: Locale.Collation { get }

Discussion

This property corresponds to the co key of the Unicode BCP 47 extension.

For locale instances created with the co specifier (such as en-US@co=phonetic), or with a custom Locale.Components, this property represents the custom collation. Otherwise, it represents the locale’s default sort order.