Skip to content

Instantly share code, notes, and snippets.

@almaleh
Last active January 17, 2020 01:55
Show Gist options
  • Select an option

  • Save almaleh/b79da7f3a424e6817f6ae633a6756321 to your computer and use it in GitHub Desktop.

Select an option

Save almaleh/b79da7f3a424e6817f6ae633a6756321 to your computer and use it in GitHub Desktop.
let imageProcessingQueue = DispatchQueue(label: "com.besher.image-processing")
func processImageAsync(data: Data) -> UIImage? {
guard let image = UIImage(data: data) else { return nil }
imageProcessingQueue.async {
let processedImage = upscaleAndFilter(image: image)
return processedImage
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment