title: Wait for two completion handlers?
body: <p>Inside my app, I do few requests to my back-end. In one case I have a function that should return two parameters (may be <code>Bool</code> and <code>Bool</code> for example). But there comes my problem. To return those two parameters, I need to receive some info from back-end first, so it would look like this (will be written in pseudo-swift-code):<br/></p>
  
  <pre><code>func request() -&gt; (Bool, Bool) {
      var one: Bool?
      var two: Bool?
  
      Alamofire.request(url1).response { (response) in
          if let response = response { one = response }
      }
  
      Alamofire.request(url2).response { (response) in
          if let response = response { two = response }
      }
  
      if let one = one, let two = two {
          return (one, two)
      }
  
      return (nil, nil)
  }
  </code></pre>
  
  <p>How do I achieve a function that waits for those two web requests?</p>