Created
June 2, 2021 19:19
-
-
Save sgl0v/37a33ffd7691b81c40cca0f7962eb836 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
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