I'm trying to retrieve the last photo (last item) from the photos library. I'm using the following code to do that:
let fetchOptions = PHFetchOptions()
fetchOptions.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
fetchOptions.fetchLimit = 1
let fetchResult = PHAsset.fetchAssets(with: .image, options: fetchOptions)
The thing is that I have added an image to my photos library which has an old creation date from like 2012. So even though that image is at the end of the list in the photos app it's not being retrieved because the creationDate is old. I tried using fetchOptions.sortDescriptors = [NSSortDescriptor(key: "modificationDate", ascending: false)] to no avail.
Is there a way to fetch the last image from the photos library (independently of creationDate)?