Just test

  1. URLSession:downloadTask:didFinishDownloadingToURL:
    执行NSURLSessionDownloadTask下载数据到本地,当下载完成时,会触发该方法,代码注释如下:
  2. URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:
    执行NSURLSessionDownloadTask下载数据的过程中,会触发该方法通知下载的进度,代码注释如下:
    ```
     (void)URLSession:(NSURLSession *)session
     downloadTask:(NSURLSessionDownloadTask *)downloadTask
     didWriteData:(int64_t)bytesWritten
     totalBytesWritten:(int64_t)totalBytesWritten
    totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
    {
     if (self.downloadTaskDidWriteData) { //将进度数据回调给外界
     self.downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite);
     }
    }
    ```
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.