I am trying to export a UIImage to the camera roll when the user presses an export button. The button calls this method.
I have checked that the method is being called, I've checked the size of the photo, I've even displayed the image from this method when it's called. But the UIImageWriteToSavedPhotosAlbum does not work on the simulator or on my actual device.
I've tried providing a method to be called with an error, and the only error message that I get is "Save error 0x00007fdfcc1686c0" which seems totally useless.
@IBAction func exportButtonPressed(sender: AnyObject) {
if qrcodeImage != nil {
let imageToSave = imgQRCode.image!
UIImageWriteToSavedPhotosAlbum(imageToSave, self, "image:didFinishSavingWithError:contextInfo:", nil);
}
}