我一直在寻找 swift3 中 dispatch_apply 的等价物。请帮助我
转换
let queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_apply(2, queue) { (index) in
}
最佳答案
你还记得dispatch_apply()。好吧,它还在那里,并有了一个新名字。从现在开始,您必须调用 concurrentPerform()
改变这个
dispatch_apply(2, queue) { (index) in
}
进入
DispatchQueue.concurrentPerform(iterations: 2) {
print("\($0). concurrentPerform")
}
关于ios - Swift 3 中的 "dispatch_apply"是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39590128/