         }
     }
 
-    func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError sessionError: NSError?) {
+    public func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError sessionError: NSError?) {
         let download = self.downloads[task.taskIdentifier]!
         var error: NSError? = sessionError ?? download.error
         // Handle possible HTTP errors

        }
    }

    func URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didFinishDownloadingToURL location: NSURL) {
        let download = self.downloads[downloadTask.taskIdentifier]!
        var fileError: NSError?
        var resultingURL: NSURL?

}


public class DownloadDelegate: NSObject, NSURLSessionDownloadDelegate {

    public var backgroundTransferCompletionHandler: (() -> Void)? = {}
    
    var downloads: [Int: TCBlobDownload] = [:]
    let acceptableStatusCodes: Range<Int> = 200...299

