         }
 
         return false
+    }
+
+    private func finishDownloadTask(downloadTask: NSURLSessionDataTask) {
+
+        for i in 0..<progressReporters.count {
+
+            for j in 0..<progressReporters[i].tasks.count {
+
+                if downloadTask == progressReporters[i].tasks[j].downloadTask {
+
+                    let finishedAction = progressReporters[i].tasks[j].finishedAction
+                    let data = progressReporters[i].tasks[j].tempData
+                    finishedAction(data)
+
+                    progressReporters[i].finishedTasksCount++
+
+                    // 若任务都已完成，移除此 progressReporter
+                    if progressReporters[i].finishedTasksCount == progressReporters[i].tasks.count {
+                        progressReporters.removeAtIndex(i)
+                    }
+                    
+                    return
+                }
+            }
+        }
     }
 
     func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveResponse response: NSURLResponse, completionHandler: (NSURLSessionResponseDisposition) -> Void) {


                if downloadTask == progressReporter.tasks[i].downloadTask {

                    progressReporter.tasks[i].progress.completedUnitCount += didReceiveDataBytes

                    progressReporter.reportProgress?(progressReporter.totalProgress)


    func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) {
        print("YepDownloader data.length: \(data.length)")

        let finish = reportProgressAssociatedWithDownloadTask(dataTask, didReceiveData: data)

        if finish {
            print("finish")

            finishDownloadTask(dataTask)
        }
    }
}
