title: Closure called immediately using Alamo fire
body: <p>I am writing a small wrapper around some Alamo fire calls and getting some issues with closures, the closure is called prior to Alamo fires response</p>
  
  <pre class="lang-swift prettyprint-override"><code>var manager = Alamofire.SessionManager.default {
     didSet {
        self.manager.session.configuration.timeoutIntervalForRequest = 30
     }
  }
  
  //Create my function signature
  func sendInformation(parameters: [String: Any], completion: @escaping (_ success: Bool, _ error: String?) -&gt; Void) {
     //helper for creating params / headers etc 
     let request = HelperRequest().submitNewPassport(parameters: parameters)
  
     manager.request(request.requestURL,
        method: request.method,
        parameters: request.parameters,
        encoding: request.encoding,
        headers: request.headers).responseJSON { (response) in
           print("** Updated called")
           if response.result.isSuccess {
              //show success
              completion(true, nil)
              return
           } else {
              //show error
              completion(false, error.localizedDescription)
              return
           }
  completion(false, nil)
  </code></pre>
  
  <p>However, when this is called I get a failure completion immediately before a the request is made and a following correct callback</p>
  
  <pre class="lang-swift prettyprint-override"><code>sendInformation(parameters: params,  { (success, error) -&gt; Void in
     if success {
        print("** success")
     } else {
        print("** error ")
     }
  </code></pre>
  
  <p>The log looks as follows</p>
  
  <pre><code>** error 
  ** Updated called
  ** Success
  </code></pre>