title: Adding a completion handler to Alamofire
body: <p>I'm working on a small chunk of Swift code to work with pulling data via web-based APIs. Right now I am close, but think I'm missing the completion handler aspect when I print the data within the getUserInfo() expected data is there, but outside that function, the initialized default data appears. The function is called like this: </p>
  
  <pre><code>print("Provided Username is: \(workingData.user)")
  getUserInfo()
  print("Returned String Data is: \(workingData.responseDataString)")
  </code></pre>
  
  <p>and the actual function:</p>
  
  <pre><code>func getUserInfo() {
      Alamofire.request(workingjss.jssURL + devAPIMatchPath + workingData.user, method: .get)
          .authenticate(user: workingjss.jssUsername, password: workingjss.jssPassword).responseString { response in
              if (response.result.isSuccess) {
                  print("In Function Data: \(response.result.value!)"
                  workingData.responseDataString = response.result.value!
              }
      }
  }
  </code></pre>
  
  <p>The output in running the code is:</p>
  
  <pre><code>Provided Username is: MYUSER
  Returned String Data is: Nothing Here Yet 
  In Function Data: {"Cleaned JSON Data here"}
  </code></pre>
  
  <p>Would a completion handler help the issue out? I'm pretty new to working with Alamofire so sorry if this is an easy one. Thanks!</p>