从用户的照片库中删除照片? [英] Delete a photo from the user's photo library?

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

问题描述

有没有办法可以从 UIImagePickerController 中删除​​加载到我的应用中的图片?

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.

请帮助!

推荐答案

Apple实际上不允许您通过API从照片库中删除。用户必须实际转到照片应用并自行手动删除。 Apple确实允许您写入照片库:

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:


要将静止图像保存到用户的
已保存照片相册,请使用
UIImageWriteToSavedPhotosAlbum
函数。要将电影保存到
用户保存的照片专辑,使用
UISaveVideoAtPathToSavedPhotosAlbum
功能。

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.

但是对于删除和编辑/覆盖现有照片,Apple现在没有类似的东西。

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

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

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