2016-02-05 92 views
0

我使用ELCImagePickerController從我的應用程序中的照片應用程序中選擇多個圖像。 我想從ELCImagePickerController中選擇的照片應用中刪除這些圖像。 請幫我解決這個問題。如何從ELCImagePickerController選擇的照片應用程序中刪除多個圖像?

ELCImagePickerController允許兩種方法。

- (void)elcImagePickerController:(ELCImagePickerController *)picker didFinishPickingMediaWithInfo:(NSArray *)info; 
- (void)elcImagePickerControllerDidCancel:(ELCImagePickerController *)picker; 

回答

0

您將需要使用PHPhotoLibrary

使用PHAssetChangeRequest

對於我的項目,我用這個,這是迅速的,但我希望這會給你正確的想法。這完美的作品對我來說:

PHPhotoLibrary.sharedPhotoLibrary().performChanges({ 
     PHAssetChangeRequest.deleteAssets(photoAssets) 
     }, completionHandler: { success, error in 
     NSLog("Completed deletion of asset. %@", (success ? "Success" : error!)) 
}) 

你想在didFinishPickingMediaWithInfo

希望這有助於實現這一點。

相關問題