title: Download a file with NSURLSession in Swift
body: <p>i have like 2 problems here , first i cant set NSURLSessionDownloadDelegate with a swift project, compiler says </p>
  
  <pre><code>Type 'ViewController' does not conform to protocol 'NSURLSessionDownloadDelegate'
  </code></pre>
  
  <p>Second problem is i cant find NSURLSession methods to download a simple file</p>
  
  <p>here is the way i use to download the simple file </p>
  
  <pre><code>    var url:NSURL = NSURL.URLWithString(fileURL)
      var request:NSURLRequest = NSURLRequest(URL: url)
      var downloadTask:NSURLSessionDownloadTask = sessionManager.downloadTaskWithRequest(request)
      downloadTask.resume()
  </code></pre>
  
  <p>and these are the methods i want to make in swift </p>
  
  <pre><code>URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
  </code></pre>
  
  <p>.. </p>
  
  <pre><code>URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location
  </code></pre>
  
  <p>..</p>
  
  <pre><code>URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error
  </code></pre>
  
  <p>..
  if there is a new way to download files with NSURLSession i would like to know , and whats new in NSURLSession in swift </p>