---
title: "init(_:order:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/sortdescriptor/init(_:order:)-4doe9"
---

# init(_:order:)

## Declaration

```swift
init<Value>(_ keyPath: any KeyPath<Compared, Value> & Sendable, order: SortOrder = .forward) where Value : Comparable
```
