StructureFoundationEssentials
Locale.Collation
iOS 16.0+
iPadOS 16.0+
Mac Catalyst 16.0+
macOS 13.0+
tvOS 16.0+
watchOS 9.0+
A type that represents the string sort order used by the locale.
struct Collation
Topics
Operators
Initializers
init(String)Creates a collation from a BCP 47 identifier.init(from: any Decoder) throwsinit(stringLiteral: String)Creates a collation from a BCP 47 identifier as a string literal.
Instance Properties
var debugDescription: Stringvar identifier: StringThe collation’s BCP 47 identifier.
Instance Methods
Type Properties
static var availableCollations: [Locale.Collation]A list of available collations on the system.static let searchRules: Locale.CollationA collation used for string search.static let standard: Locale.CollationA collation that provides the default ordering for each language.
Type Methods
static func availableCollations(for: Locale.Language) -> [Locale.Collation]A list of available collations for the specifiedlanguagein the order that it is most likely to make a difference.
Relationships
Conforms To
Swift.CopyableSwift.CustomDebugStringConvertibleSwift.DecodableSwift.EncodableSwift.EquatableSwift.EscapableSwift.ExpressibleByExtendedGraphemeClusterLiteralSwift.ExpressibleByStringLiteralSwift.ExpressibleByUnicodeScalarLiteralSwift.HashableSwift.SendableSwift.SendableMetatype