从iOS照片库删除图像 [英] Delete Images From iOS Photo Gallery

查看:57
本文介绍了从iOS照片库删除图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个应用程序,该应用程序从手机的照片库中获取图像并将其显示在收藏夹视图中.现在,我希望每当用户选择一个图像并单击删除按钮时,该特定图像就会从集合视图以及图像库中删除.我正在使用ALAssetLibrary来获取图像.我进行了很多搜索,但没有找到从照片库中删除图片的任何方法.

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.

推荐答案

您可以将库中的文件复制到应用程序的文件系统沙箱中,您可以在其中使用它们进行任何操作.但是,您的应用程序无法修改沙箱外部的文件.这包括图库中的文件.

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.

这篇关于从iOS照片库删除图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆