views:

391

answers:

1

Hi,

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!

+2  A: 

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.

John Wang