title: Swift 2.0 NSURLConnection sendSynchronousRequest
body: <p>I am using the code below to check for an internet connection. It was working correctly but after the Swift 2.0 update I now see an error on the line <code>var data = NSURLConnection.sendSynchronousRequest(request, returningResponse: &amp;response, error: nil) as NSData?</code> saying extra argument 'error' in call.</p>
  
  <pre><code>class func isConnectedToNetwork()-&gt;Bool{
  
      var Status:Bool = false
      let url = NSURL(string: "http://google.com/")
      let request = NSMutableURLRequest(URL: url!)
      request.HTTPMethod = "HEAD"
      request.cachePolicy = NSURLRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData
      request.timeoutInterval = 10.0
  
      var response: NSURLResponse?
  
      var data = NSURLConnection.sendSynchronousRequest(request, returningResponse: &amp;response, error: nil) as NSData?
  
      if let httpResponse = response as? NSHTTPURLResponse {
          if httpResponse.statusCode == 200 {
              Status = true
          }
      }
  
      return Status
  }
  </code></pre>
  
  <p>Do you have any ideas what I should change it to? 
  Thanks</p>