【发布时间】:2020-12-03 19:30:39
【问题描述】:
如何在我目前拥有的 while 循环中拥有异步任务
myGroup = DispatchGroup()
while *condition* {
myGroup.enter()
query.getDocuments { (blah, blah) in
arr.append(docs)
//...
}
myGroup.leave()
}
completion(arr)
enter code here
这不起作用,因为它只是在跳过异步 .getDocuments 部分时立即返回到 while 循环
【问题讨论】:
标签: ios swift firebase asynchronous google-cloud-firestore