Delete Images From iOS Photo Gallery [duplicate]

一笑奈何 提交于 2019-12-21 16:19:09

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/21477463/delete-images-from-ios-photo-gallery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!