更新时间:2023-01-06 13:06:35
只需添加到上面, 对于Swift 3.0,它对我有用.
Just to add to the above, For swift 3.0 this worked for me.
PHPhotoLibrary.shared().performChanges({
let imageAssetToDelete = PHAsset.fetchAssets(withALAssetURLs: imageUrls as! [URL], options: nil)
PHAssetChangeRequest.deleteAssets(imageAssetToDelete)
}, completionHandler: {success, error in
print(success ? "Success" : error )
})