URLSession

open override fun URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didFinishDownloadingToURL: NSURL)

Called when the download finishes successfully. The file is at location — move it to a permanent location in this callback.


open override fun URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError: NSError?)

Called when the task completes — with or without error. If error is non-null, the download failed.


open override fun URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didWriteData: Long, totalBytesWritten: Long, totalBytesExpectedToWrite: Long)

Called periodically with download progress.