Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete a photo from the user's photo library?

Is there a way I can delete an image that is loaded into my app from a UIImagePickerController?

I want to be able to delete the image from the user's photo library when the user performs a specific action.

I am prompting the user to choose a image from their library, then it gets loaded into my app at which point the app does some shnazzy animation, then actually deletes the image.

Please help!

like image 220
Jacob Relkin Avatar asked Jan 31 '10 19:01

Jacob Relkin


People also ask

How do you delete a photo from your library on Instagram?

First, go to the post and tap the three dots in the top right corner of your screen. Ignore the bright red “delete” option, hit Edit and scroll to the image or video you want to send to the trash. Now, tap the little trash can icon in the top left corner of the image.

Does deleting a photo from an album delete it from the library?

No, that is not possible. The standard albums are not storing photos. They are only referencing them in the library. If you delete a photo from the library , it will be removed from all albums that are using the photo.


1 Answers

Apple doesn't actually allow you to delete from the photo library through an API. The user has to actually go to the Photos app and delete it manually themselves. Apple does allow you write to the photo library:

To save a still image to the user’s Saved Photos album, use the UIImageWriteToSavedPhotosAlbum function. To save a movie to the user’s Saved Photos album, use the UISaveVideoAtPathToSavedPhotosAlbum function.

But for deleting and editing/overriding an existing photo, Apple doesn't have anything like that right now.

like image 100
John Wang Avatar answered Oct 29 '22 05:10

John Wang