How to synchronize multiple Alamofire requests
<p>I have multiple requests:</p>

<pre><code>var data1: MyData?
var data2: MyData?
var data3: MyData?

func makeRequest(url: String, completion: (result: ResponseResult, data: MyData?) -&gt; Void){
    Alamofire.request(.GET, url).responseJSON { response in
        switch response.result {
        case .Success(let JSON):
        completion(result: .Success, MyData(JSON))
        case. Failure(let error):
        completion(result: .Failure, nil)
        }
    }
}

makeRequest(url1){ result, data in
    data1 = data
}
makeRequest(url2){ result, data in
    data2 = data
}
makeRequest(url3){ result, data in
    data3 = data
}
</code></pre>

<p>And after all data was received i must call the following function:</p>

<pre><code>workWithData(data1, data2: data2, data3: data3)
</code></pre>

<p>How to make barrier for that three requests in that situation?</p>