Skip to content

Instantly share code, notes, and snippets.

@fitomad
Created September 1, 2018 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitomad/1675916e892a1584d04249c7e3b09d33 to your computer and use it in GitHub Desktop.
Save fitomad/1675916e892a1584d04249c7e3b09d33 to your computer and use it in GitHub Desktop.
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) -> Void
{
// 1
guard let image = info[UIImagePickerControllerOriginalImage] as? UIImage,
let ciImage = image.ciImage
else
{
return
}
// 2
let imageRequest = VNImageRequestHandler(ciImage: ciImage)
// 3
do
{
try imageRequest.perform([ self.requestText ])
}
catch error
{
print("No podemos procesar la imagen del Carrete de Fotos. \(error.localizedDescription)")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment