title: waiting for users response in swift
body: <p>I created an alert:</p>
  
  <pre><code>var a = 0 // default
  let userAction = UIAlertController(title: "Select", message: "Select an action", preferredStyle: UIAlertControllerStyle.alert)
  
  userAction.addAction(UIAlertAction(title: "action 1", style: .default, handler: { (action: UIAlertAction!) in
      a = 1
  }))
  
  userAction.addAction(UIAlertAction(title: "action 2", style: .cancel, handler: { (action: UIAlertAction!) in
      a = 2
  }))
  
  present(userAction, animated: true, completion: nil)
  
  let resp = Just.get("http://localhost/\(a)").text
  return resp
  </code></pre>
  
  <p>and after this code i'm sending a request with a parameter(a) but request is sent before choosing an action.
  how can i wait till user choose and action from alert? </p>