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!
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With