<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PhotoKit",
  "identifier" : "/documentation/Photos/PHFetchOptions/sortDescriptors",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Photos"
    ],
    "preciseIdentifier" : "c:objc(cs)PHFetchOptions(py)sortDescriptors"
  },
  "title" : "sortDescriptors"
}
-->

# sortDescriptors

A list of sort descriptors, specifying an order for the fetched objects.

```
var sortDescriptors: [NSSortDescriptor]? { get set }
```

## Discussion

Construct sort descriptors with the properties of the objects that you want to fetch, listed in the [`PHFetchOptions`](/documentation/Photos/PHFetchOptions) table. For example, the following code sorts by creation date to find the oldest asset in the photo library.

```swift
let fetchOptions = PHFetchOptions()
fetchOptions.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: true)]
let fetchResult = PHAsset.fetchAssets(with: fetchOptions)
return fetchResult.firstObject
```

---

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)