美文网首页
Swift Alamofire 多请求DispatchGroup

Swift Alamofire 多请求DispatchGroup

作者: wolfhs | 来源:发表于2018-07-17 09:40 被阅读0次
        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) {
              //请求全部完毕
        }

相关文章

网友评论

      本文标题:Swift Alamofire 多请求DispatchGroup

      本文链接:https://www.haomeiwen.com/subject/qcnvpftx.html