Skip to content

Instantly share code, notes, and snippets.

@varun04
Created August 5, 2021 07:23
Show Gist options
  • Select an option

  • Save varun04/091d626daeca62451b6eabc27e27e77c to your computer and use it in GitHub Desktop.

Select an option

Save varun04/091d626daeca62451b6eabc27e27e77c to your computer and use it in GitHub Desktop.
let imageDecoder = DBImageDecoder()
var imageData = Data()
func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
imageData.append(data)
imageDecoder.setData(imageData, allDataReceived: false)
}
func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
imageDecoder.setData(imageData, allDataReceived: true)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment