title: Swift syntax for block with completionHandler... in delegate method
body: <p>This is a wrinkle on the regular NSURLSession completion block problem, which I'm having a heck of a time resolving into Swift syntax.  The method is the authentication delegate callback, which is invoked on auth challenge; the developer calls the completion block with NSURLCredential, NSError.</p>
  
  <p>The Objective-C method looks like this:</p>
  
  <pre><code>-(void) provideUsernamePasswordForAuthChallenge:(NSURLAuthenticationChallenge *)authChallenge completionHandler:(void (^)(NSURLCredential *, NSError *))completionHandler{
  
      NSURLCredential* credential = [NSURLCredential credentialWithUser:@"myname" 
                                                               password:@"mypass" 
                                                            persistence:NSURLCredentialPersistenceForSession];
      completionHandler(credential, nil);
  }
  </code></pre>
  
  <p>The closest I think I've gotten in Swift, is this:</p>
  
  <pre><code>func provideUsernamePasswordForAuthChallenge(authChallenge: NSURLAuthenticationChallenge!,  completionHandler:(() -&gt; (NSURLCredential?, NSError?)) {
  
      var cred = NSURLCredential(user: "myname", password: "mypass", persistence: NSURLCredentialPersistence.ForSession)
      return (cred, nil)
  })
  </code></pre>
  
  <p>But, it's still barfing.  Any recommendations?</p>