2016-09-20 99 views

回答

10

你还记得dispatch_apply()。那么,它仍然在那里,并得到一个新的名字。从现在开始,你必须调用concurrentPerform()

改变这种

dispatch_apply(2, queue) { (index) in 
} 

DispatchQueue.concurrentPerform(iterations: 2) { 
print("\($0). concurrentPerform") 
}