Skip to content

Instantly share code, notes, and snippets.

@sgl0v
Created June 2, 2021 19:19
Show Gist options
  • Save sgl0v/37a33ffd7691b81c40cca0f7962eb836 to your computer and use it in GitHub Desktop.
Save sgl0v/37a33ffd7691b81c40cca0f7962eb836 to your computer and use it in GitHub Desktop.
final class ImageColorizer {
func colorize(image inputImage: UIImage, completion: @escaping (Result<UIImage, Error>) -> Void) {
DispatchQueue.background.async {
let result = self.colorize(image: inputImage)
DispatchQueue.main.async { completion(result) }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment