Created
November 19, 2019 04:33
-
-
Save dmytro-anokhin/0d262d1d19cb7c72e5095206abcdf583 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 = ImageDecoder() | |
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