Created
August 5, 2021 07:23
-
-
Save varun04/091d626daeca62451b6eabc27e27e77c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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