PHAsset's modificationDate changes every time on fetching from iOS Photos app

287 views Asked by At

I am fetching PHAsset using localIdentifier and observing that PHAsset modificationDate is changes every time

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

if let asset = PHAsset.fetchAssets(withLocalIdentifiers: [localIdentifier], options: options).lastObject {

    print("modificationDate = \(asset.modificationDate)")
}

Modification date is always the current date. I have no idea why I am getting such modification date when I am only fetching PHAsset.

Does anyone have any idea or reference to get actual PHAsset modification date.

I need to do backup of media in my app as per it's modification time.

0

There are 0 answers