Skip to content

Instantly share code, notes, and snippets.

@chriswebb09
Created May 11, 2017 09:47
Show Gist options
  • Select an option

  • Save chriswebb09/dae821bb48dc513fd603f36a78c7632b to your computer and use it in GitHub Desktop.

Select an option

Save chriswebb09/dae821bb48dc513fd603f36a78c7632b to your computer and use it in GitHub Desktop.
extension iTunesAPIClient: URLSessionDelegate {
internal func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) {
// Calls background session completion in AppDelegate
}
internal func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64,totalBytesExpectedToWrite: Int64) {
// Gives you the URLSessionDownloadTask that is being executed
// along with the total file length - totalBytesExpectedToWrite
// and the current amount of data that has received up to this point - totalBytesWritten
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment