Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created July 23, 2022 02:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/e0dcd72fc10011b4b8e8960c1810413b to your computer and use it in GitHub Desktop.
Save laevandus/e0dcd72fc10011b4b8e8960c1810413b to your computer and use it in GitHub Desktop.
struct ImageProcessor {
func process(_ imageData: Data) async -> UIImage {
print(#function, Thread.isMainThread, Thread.current)
let image = await Task {
syncProcessData(imageData)
}.value
print(#function, Thread.isMainThread, Thread.current)
return image
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment