Configurar delegado para UIImagePicker devuelve error
Teniendo un problema en algún código rápido que había escrito para una aplicación de traducción OCR. El fragmento de código está a continuación:
@IBAction func btnOCR(sender: AnyObject) {
var languageAlert = UIAlertController(title: "For Your Information...", message: "The OCR feature currently only supports English & French.", preferredStyle: .Alert)
languageAlert.addAction(UIAlertAction(title: "Okay", style: .Default, handler: { action in
var image = UIImagePickerController()
image.sourceType = UIImagePickerControllerSourceType.Camera
image.allowsEditing = false
image.delegate = self
presentViewController(image, animated: true, completion: nil)
}))
self.presentViewController(languageAlert, animated: true, completion: nil)
}
Image.delegate = self line devuelve el error: no se puede asignar un valor de tipo viewcontroller a uiimagepickerdelegate.
He configurado el delegado en la definición de clase, esto se puede ver a continuación ...
class ViewController: UIViewController, UITextFieldDelegate, UIPickerViewDelegate, UIPickerViewDataSource, UIImagePickerControllerDelegate { }
Toda y cualquier ayuda sería apreciada, gracias de antemano.