3

I can write photos to camera roll, but how can I delete one?

I remember a couple years ago someone said it is impossible, but I believe I have seen an app recently that did it.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
openfrog
  • 40,201
  • 65
  • 225
  • 373

4 Answers4

3

To delete photo from camera roll is not possible from application. Apple has never given access of delete photo of camera roll from application.

iPhone developer.
  • 2,122
  • 1
  • 16
  • 17
3

This is now possible (since iOS 8). Hopefully this helps other folks who end up here from Google.

To do this, check out the deleteAssets method of the PHAssetChangeRequest class.

Docs here: https://developer.apple.com/library/ios/documentation/Photos/Reference/PHAssetChangeRequest_Class/#//apple_ref/occ/clm/PHAssetChangeRequest/deleteAssets:

scosman
  • 2,343
  • 18
  • 34
  • Interesting. Skimmed through the docs but couldn't find the part where the system asks for permission from the user before deleting items. I assume it **must** happen at some point. – Nicolas Miari Jan 07 '16 at 05:43
  • 1
    @NicolasMiari it prompts the user when you call that. It tells them how many photos you are deleting and lets them confirm/deny. – scosman Jan 07 '16 at 06:05
1

I could be wrong but I do not think you can delete photos that were not created or stored by your app. AT least I have not seen an Apple API to do that.

sangony
  • 11,636
  • 4
  • 39
  • 55
0

You can try 百度魔拍 it really can delete photo from camera roll. (https://itunes.apple.com/cn/app/bai-du-mo-pai/id655426839?mt=8)

fanzhou
  • 97
  • 1
  • 5