Created
June 2, 2021 19:20
-
-
Save sgl0v/b3055d4cb52317532f67161ac6425e8e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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