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

            return
        }
    }
}

        }
    }

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