---
title: compareForcedOrdering
framework: corefoundation
role: symbol
role_heading: Type Property
path: corefoundation/cfstringcompareflags/compareforcedordering
---

# compareForcedOrdering

Specifies that the comparison is forced to return either kCFCompareLessThan or kCFCompareGreaterThan if the strings are equivalent but not strictly equal.

## Declaration

```swift
static var compareForcedOrdering: CFStringCompareFlags { get }
```

## Discussion

Discussion You use this option for stability when sorting (for example, with kCFCompareCaseInsensitive specified “aaa” is greater than “AAA”).

## See Also

### Constants

- [compareCaseInsensitive](corefoundation/cfstringcompareflags/comparecaseinsensitive.md)
- [compareBackwards](corefoundation/cfstringcompareflags/comparebackwards.md)
- [compareAnchored](corefoundation/cfstringcompareflags/compareanchored.md)
- [compareNonliteral](corefoundation/cfstringcompareflags/comparenonliteral.md)
- [compareLocalized](corefoundation/cfstringcompareflags/comparelocalized.md)
- [compareNumerically](corefoundation/cfstringcompareflags/comparenumerically.md)
- [compareDiacriticInsensitive](corefoundation/cfstringcompareflags/comparediacriticinsensitive.md)
- [compareWidthInsensitive](corefoundation/cfstringcompareflags/comparewidthinsensitive.md)
