let group = DispatchGroup()//创建
for i in 0..<10{
group.enter()//加入组
Alamofire.request(urlstring, method:.post).responseJSON { (returnResult) in
group.leave()//离开组
}
}
group.notify(queue: DispatchQueue.main) {
//请求全部完毕
}
网友评论