title: Implement Delegate with Closure in Swift?
body: <p>Suppose I'm using Swift and calling a method in the framework that is expecting a delegate.  </p>
  
  <p>Is it possible to provide a closure and implement the delegate right there inline?  </p>
  
  <p>I'm hoping to be able to use this like anonymous classes in Java.  For Example:</p>
  
  <pre><code>let cnx:NSURLConnection = NSURLConnection(request: request, delegate: {
       func connection(connection: NSURLConnection!, didReceiveData data: NSData!){
           //append data
       }
       func connectionDidFinishLoading(connection: NSURLConnection){
           //all done
       }
  });
  </code></pre>