Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sgl0v/b3055d4cb52317532f67161ac6425e8e to your computer and use it in GitHub Desktop.
Save sgl0v/b3055d4cb52317532f67161ac6425e8e to your computer and use it in GitHub Desktop.
extension ImageScanner: UIImagePickerControllerDelegate {
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
guard let uiImage = info[UIImagePickerController.InfoKey.originalImage] as? UIImage else {
dismissController(picker, with: .failure(ImageProviderError.internalError))
return
}
DispatchQueue.background.async {
let result = self.postProcessImage(uiImage)
self.dismissController(picker, with: result)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment