How to remove a video from a custom album in Photos if I have its URL? I have seen many posts on StackOverflow how to delete a photo, but none of the answers work. It simply does not delete the video.

The problem is not the button, because it works fine, it prints “ok”. The problem is removing the code.

Here is my code:

var library = PHPhotoLibrary.shared() library.performChanges({ var assetsToBeDeleted = PHAsset.fetchAssets(withALAssetURLs: assetsURLs, options: nil) as? PHFetchResult if let aDeleted = assetsToBeDeleted { PHAssetChangeRequest.deleteAssets(aDeleted) } }, completionHandler: { success, error in //do something here } }) 

    0