I need to show progress of deleting photos and videos from photo library. In case of few photos - deletion can take few seconds but in case of 1000 photos - it will take few minutes. So, i need to show a progress somehow. How can I do that?
My code
PHPhotoLibrary.shared().performChanges({
PHAssetChangeRequest.deleteAssets(assets as NSFastEnumeration)
}, completionHandler: { success, error in
DispatchQueue.main.async {
if let error = error {
print(error.localizedDescription)
}
}
})