0

I'm working with Apple's sample code for PhotoBrowse.

In the main view controller's viewDidLoad() method we have this code:

let allPhotosOptions = PHFetchOptions()
allPhotosOptions.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: true)]

This code sorts the photos by "creationDate". How do I determine/find the other valid values for these sort descriptors? For example, what if I wanted to sort photos by their file size, last modified date, etc.?

TIA!

Offswitch
  • 51
  • 5

1 Answers1

0

You can find the available sort descriptors in the documentation for PhotoKit PHFetchOptions.

Note, there are NO descriptors that allow for sorting by photo/movie file size.

HangarRash
  • 7,314
  • 5
  • 5
  • 32
Offswitch
  • 51
  • 5