So I have code that will delete images from the camera roll. It works fine, and can delete single images from a burst, however one of the images, if deleted, will delete the entire batch and I can't figure out how to stop that. It usually seems to be the last image in the burst group. And in my request options, I turn on includeAllBurstAssets
.
func deletePhotos(assetsToDelete: [PHAsset]){
PHPhotoLibrary.sharedPhotoLibrary().performChanges({
PHAssetChangeRequest.deleteAssets(assetsToDelete)
return
}, completionHandler: { success, error in
guard let error = error else {
return
}
print(error)
}
})
}