Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete Images From iOS Photo Gallery [duplicate]

I have created an Application that fetches Images from the photo library of the phone and displays it on a collection view. Now, I want that whenever the user selects an image and click on a delete button that particular image gets deleted from the collection view as well as from the image library. I am using ALAssetLibrary to fetch the images. I searched a lot but did not find any way to delete the image from the photo library.

Can anybody tell me that how I can delete a photo from photo library programmatically from my application.

like image 273
Santosh Avatar asked Oct 02 '22 17:10

Santosh


1 Answers

You can copy files from the gallery into your application's file system sandbox, where you can do anything you want with them. However, your application can't modify files outside the sandbox. This includes files in the gallery.

As this answer says, there doesn't appear to be a method defined for deleting photos there.

like image 167
etolstoy Avatar answered Oct 12 '22 23:10

etolstoy