I was able to get the list of photos from photo library with the following code.
guard let assetCollection = collection as? PHAssetCollection
else { fatalError("asset collection is required.") }
destination.fetchResult = PHAsset.fetchAssets(in: assetCollection, options: nil)
destination.fetchResult gets all the Photos in terms of PHAssets.I want to f find duplicate photos present in PHFetchResult.
Please suggest any advices.
TL;DR Assumptions based on Image metadata similarity or Image similarity may work, but no guarantee.
Photos framework does not provide you with an information on how one picture is similar to another. You can only make an assumption that if pictures were taken in the same place (use PHAsset location and the same time (PHAsset creation date), and has more similar parameters.
But there is no guarantee, that these images will be identical. You can also analyze image similarity using, for instance, Image hashing algorithms. Good luck!