---
title: Unicode.CanonicalCombiningClass
framework: swift
role: symbol
role_heading: Structure
path: swift/unicode/canonicalcombiningclass
---

# Unicode.CanonicalCombiningClass

The classification of a scalar used in the Canonical Ordering Algorithm defined by the Unicode Standard.

## Declaration

```swift
struct CanonicalCombiningClass
```

## Overview

Overview Canonical combining classes are used by the ordering algorithm to determine if two sequences of combining marks should be considered canonically equivalent (that is, identical in interpretation). Two sequences are canonically equivalent if they are equal when sorting the scalars in ascending order by their combining class. For example, consider the sequence "\u{0041}\u{0301}\u{0316}" (LATIN CAPITAL LETTER A, COMBINING ACUTE ACCENT, COMBINING GRAVE ACCENT BELOW). The combining classes of these scalars have the numeric values 0, 230, and 220, respectively. Sorting these scalars by their combining classes yields "\u{0041}\u{0316}\u{0301}", so two strings that differ only by the ordering of those scalars would compare as equal: let aboveBeforeBelow = "\u{0041}\u{0301}\u{0316}" let belowBeforeAbove = "\u{0041}\u{0316}\u{0301}" print(aboveBeforeBelow == belowBeforeAbove) // Prints "true" Named and Unnamed Combining Classes Canonical combining classes are defined in the Unicode Standard as integers in the range 0...254. For convenience, the standard assigns symbolic names to a subset of these combining classes. The CanonicalCombiningClass type conforms to RawRepresentable with a raw value of type UInt8. You can create instances of the type by using the static members named after the symbolic names, or by using the init(rawValue:) initializer. let overlayClass = Unicode.CanonicalCombiningClass(rawValue: 1) let overlayClassIsOverlay = overlayClass == .overlay // overlayClassIsOverlay == true

## Topics

### Operators

- [==(_:_:)](swift/unicode/canonicalcombiningclass/==(_:_:).md)
- [<(_:_:)](swift/unicode/canonicalcombiningclass/_(_:_:).md)

### Initializers

- [init(rawValue:)](swift/unicode/canonicalcombiningclass/init(rawvalue:).md)

### Instance Properties

- [hashValue](swift/unicode/canonicalcombiningclass/hashvalue.md)
- [rawValue](swift/unicode/canonicalcombiningclass/rawvalue-swift.property.md)

### Instance Methods

- [hash(into:)](swift/unicode/canonicalcombiningclass/hash(into:).md)

### Type Aliases

- [Unicode.CanonicalCombiningClass.RawValue](swift/unicode/canonicalcombiningclass/rawvalue-swift.typealias.md)

### Type Properties

- [above](swift/unicode/canonicalcombiningclass/above.md)
- [aboveLeft](swift/unicode/canonicalcombiningclass/aboveleft.md)
- [aboveRight](swift/unicode/canonicalcombiningclass/aboveright.md)
- [attachedAbove](swift/unicode/canonicalcombiningclass/attachedabove.md)
- [attachedAboveRight](swift/unicode/canonicalcombiningclass/attachedaboveright.md)
- [attachedBelow](swift/unicode/canonicalcombiningclass/attachedbelow.md)
- [attachedBelowLeft](swift/unicode/canonicalcombiningclass/attachedbelowleft.md)
- [below](swift/unicode/canonicalcombiningclass/below.md)
- [belowLeft](swift/unicode/canonicalcombiningclass/belowleft.md)
- [belowRight](swift/unicode/canonicalcombiningclass/belowright.md)
- [doubleAbove](swift/unicode/canonicalcombiningclass/doubleabove.md)
- [doubleBelow](swift/unicode/canonicalcombiningclass/doublebelow.md)
- [iotaSubscript](swift/unicode/canonicalcombiningclass/iotasubscript.md)
- [kanaVoicing](swift/unicode/canonicalcombiningclass/kanavoicing.md)
- [left](swift/unicode/canonicalcombiningclass/left.md)
- [notReordered](swift/unicode/canonicalcombiningclass/notreordered.md)
- [nukta](swift/unicode/canonicalcombiningclass/nukta.md)
- [overlay](swift/unicode/canonicalcombiningclass/overlay.md)
- [right](swift/unicode/canonicalcombiningclass/right.md)
- [virama](swift/unicode/canonicalcombiningclass/virama.md)

### Default Implementations

- [Comparable Implementations](swift/unicode/canonicalcombiningclass/comparable-implementations.md)
- [Equatable Implementations](swift/unicode/canonicalcombiningclass/equatable-implementations.md)

## Relationships

### Conforms To

- [Comparable](swift/comparable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Unicode Scalar Classifications

- [Unicode.GeneralCategory](swift/unicode/generalcategory.md)
- [Unicode.NumericType](swift/unicode/numerictype.md)
