का उपयोग करके इसे चुनने के बाद PhotoLibrary से एक छवि को कैसे हटाएं मुझे PhotoLibrary
से छवि को हटाना होगा। मैं छवि लेने के लिए अपने आवेदन में UIImagePickerController
का उपयोग कर रहा हूँ। मैं अपने आवेदन में इसका उपयोग करने के बाद आईओएस फोटो लाइब्रेरी से इस छवि को हटाने की जरूरत है।UIImagePickerController
मेरे कोड स्निपेट
if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.PhotoLibrary)
{
var imagePicker = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary;
imagePicker.allowsEditing = false
self.presentViewController(imagePicker, animated: true, completion: nil)
}
// MARK:- UIImagePickerControllerDelegate
func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage!, editingInfo: [NSObject : AnyObject]!) {
pickedImage = image
saveImageToDisk(pickedImage)
/*
I need the logic to delete this image from PhotoLibrary here.
*/
self.dismissViewControllerAnimated(true, completion: nil)
refreshCollectionView()
}
इस जवाब का उल्लेख http://stackoverflow.com/questions/29466866/how-to-delete-the-last-photo-in-swift- –
http://stackoverflow.com/questions/28724105/ हटाने-ए-कैमरा-रोल-एसेट-उपयोग-फोटो-फ्रेमवर्क –