1

The documentation indicates : pick a photo from library or camera roll and delete with user permission.

Is that possible using UIImagePickerController? Or does a user have to explicitly delete the selected photo?

3
  • You do see the part of the documentation you quoted that says "delete with user permission"? Commented Dec 22, 2012 at 16:35
  • actually I never quoted the docs.It could be by chance. Commented Dec 22, 2012 at 16:57
  • Your question says "the documentation indicates", which is what I mentioned. If the documentation does not indicate that, please edit your question so it's more factual. :-) In any event, the fact that the controller name includes UI as it's first two characters indicates User Interface, which means the user is involved. Commented Dec 22, 2012 at 17:06

2 Answers 2

3

This isn't possible regardless of what you use to try to accomplish it. The UIImagePickerController is only for choosing photos and does not modify them in any way. A more promising way, would be with the Assets Library but, even with this framework, you are unable to delete a users photos. That being said, if you want to use this functionality in your app, it will have to be for jailbroken devices only.

In short, the user has to navigate to the photos app and delete the images themselves.

Sign up to request clarification or add additional context in comments.

3 Comments

why would you suggest that jailbreaking is OK?
@ArseniyBanayev Sorry, I assumed because it happened immediately after you commented.
so why would you suggest that it's a practice one should consider for one's apps?
1

Thanks to the iOS 8 Photos Framework, you can now delete images from the user library! I recommend you check out Apple's example app using the Photos Framework for a more detailed example of how to use it, but the relevant bit is:

//under SamplePhotosApp/AAPLAssetViewController.m // Delete asset from library [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{ [PHAssetChangeRequest deleteAssets:@[self.asset]]; } completionHandler:completionHandler]; 

where self.asset is a PHAsset object (which can be acquired in several ways) referring to the photo you wish to delete. Oh, and don't forget to import the Photos framework!

Hope this helps!

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.