<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/SortOrder",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation9SortOrderO"
  },
  "title" : "SortOrder"
}
-->

# SortOrder

The orderings that you can perform sorts with.

```
@frozen enum SortOrder
```

## Topics

### Using Sort Orders

[`SortOrder.forward`](/documentation/Foundation/SortOrder/forward)

The ordering that places the first item before the second when comparing two items using an ascending order.

[`SortOrder.reverse`](/documentation/Foundation/SortOrder/reverse)

The ordering that places the first item after the second when comparing two items using an ascending order.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)