Skip to content

Instantly share code, notes, and snippets.

@dmytro-anokhin
Created November 19, 2019 04:30
Show Gist options
  • Save dmytro-anokhin/07376e0c7d6e66188a4d3764ff425326 to your computer and use it in GitHub Desktop.
Save dmytro-anokhin/07376e0c7d6e66188a4d3764ff425326 to your computer and use it in GitHub Desktop.
let task = urlSession.dataTask(with: url) { data, _, _ in
guard let data = data else {
return
}
let imageDecoder = ImageDecoder()
imageDecoder.setData(data, allDataReceived: true)
guard let uiImage = imageDecoder.uiImage else {
return
}
DispatchQueue.main.async {
self.uiImage = uiImage
}
}
task.resume()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment