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

        }
    }

    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

            return
        }
    }

    public func URLSessionDidFinishEventsForBackgroundURLSession(session: NSURLSession) {
        session.getTasksWithCompletionHandler { (dataTasks, uploadTasks, downloadTasks) -> Void in

            if downloadTasks.count == 0 {
                
                if let completionHandler = self.backgroundTransferCompletionHandler {

                    NSOperationQueue.mainQueue().addOperationWithBlock({
                        [unowned self] in

                        completionHandler()
                        self.backgroundTransferCompletionHandler = nil
                    })
                }
            }
        }
    }
}
