manager.requestImage(for: asset, targetSize: size, contentMode: .aspectFit, options: options, resultHandler: { (uiImage, info) ininfo[“ PHImageResultIsDegradedKey”]let folder = FolderItem(title: title!, thumbnail: uiImage!, assets: album)self.folders.append(folder)})
this callback will call not once if the image is too big.
The first time will get you a smaller image. And the second time will give you the larger image.
info[“ PHImageResultIsDegradedKey”]
is the way to recognize duplicate callback.
2.
To get the actual image file name, we should get from
PHAssetResource.assetResources(for: photo)[0].originalFilename
is the better approach.