Skip to content

Instantly share code, notes, and snippets.

@varun04
Last active August 5, 2021 07:17
Show Gist options
  • Select an option

  • Save varun04/3c803ee48bcf60620a1821ec22285b45 to your computer and use it in GitHub Desktop.

Select an option

Save varun04/3c803ee48bcf60620a1821ec22285b45 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 = DBImageDecoder()
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