I have been searching for an equivalent of dispatch_apply in swift3. Help me please
convert
let queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_apply(2, queue) { (index) in
}
Do you still remember dispatch_apply(). Well, it's still there and got a new name. From now on you have to call concurrentPerform()
change this
dispatch_apply(2, queue) { (index) in
}
into
DispatchQueue.concurrentPerform(iterations: 2) {
print("\($0). concurrentPerform")
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With