title: Swift - downcast NSURLResponse to NSHTTPURLResponse in order to get response code
body: <p>I'm building rest queries in SWIFT using NSURLRequest </p>
  
  <pre><code>var request : NSURLRequest = NSURLRequest(URL: url)
  
  var connection : NSURLConnection = NSURLConnection(request: request, delegate: self, startImmediately: false)!
  connection.start()
  </code></pre>
  
  <p>My question is how to do i get response code out of the response that is returned: </p>
  
  <pre><code>    func connection(didReceiveResponse: NSURLConnection!, didReceiveResponse response: NSURLResponse!) {
  //...
  }
  </code></pre>
  
  <p>According to Apple:  <code>NSHTTPURLResponse</code> which is a subclass of <code>NSURLResponse</code> has a status code but I'm not sure how to downcast my response object so i can see the response code.</p>
  
  <p>This doesn't seem to cut it:</p>
  
  <pre><code>println((NSHTTPURLResponse)response.statusCode)
  </code></pre>
  
  <p>Thanks </p>