<!--
{
  "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/NSSortDescriptor/init(_:)-527yl",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:So16NSSortDescriptorC10FoundationEyAbC04SortB0VyxGcSo8NSObjectCRbzlufc"
  },
  "title" : "init(_:)"
}
-->

# init(_:)

Creates an `NSSortDescriptor` representing the same sort as the given
`SortDescriptor`.

```
@backDeployed(before: iOS 17, macOS 14, tvOS 17, watchOS 10)
convenience init<Compared>(_ sortDescriptor: SortDescriptor<Compared>) where Compared : NSObject
```

## Parameters

`sortDescriptor`

The `SortDescriptor` to convert.

---

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)