Кажется, что я не могу получить результат, отсортированный по LocalIdentifier. Вот код: < /p>
let sortDescriptor = NSSortDescriptor(key: "localIdentifier", ascending: true)
let options = PHFetchOptions()
options.sortDescriptors = [sortDescriptor]
let albums = PHCollection.fetchTopLevelUserCollections(with: options)
print(albums.count)
< /code>
У меня есть эта ошибка: < /p>
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unsupported sort descriptor in fetch options: (localIdentifier, ascending, compare:)'
< /code>
Однако в Apple Doc LocalIdentifier можно использовать в качестве ключа. < /p>
Подробнее здесь: https://stackoverflow.com/questions/426 ... identifier