title: Calling a function with a callback in objective-c from swift
body: <p>As most people I'm in the process of converting an existing app over to swift, and there are some features that can't be directly converted so instead I had to copy a few Objective-C classes over and setup a Bridging Header. All of this is done and I can call the functions, but when I call them I can't figure out how to include the callback and get the values from the callback from this method. Below is what I got so far. </p>
  
  <p>This is the typedef and method from the Objective-C file</p>
  
  <pre><code>typedef void (^DictionaryAndStatusRecievedCallBack)(BOOL status, NSDictionary *dictionary);
  -(void)verifyLoginCredentialsWithLoginName:(NSString *)loginName Passphrase:(NSString *)passPhrase callback:(DictionaryAndStatusRecievedCallBack)callback;
  </code></pre>
  
  <p>And here's how I'm calling it in the swift file</p>
  
  <pre><code>var serviceManager : MobileServiceManager = MobileServiceManager()
  typealias onCompleteBlock = (status:Bool?, values:NSDictionary?)-&gt;Void
  serviceManager.verifyLoginCredentialsWithLoginName("username", passphrase: "password", callback: ??)
  </code></pre>
  
  <p>I can't seem to figure out what to put in the callback area, I was trying a type alias since I saw another article mention that but I still couldn't get that to work either. </p>