Swift 3.0: Receiving error Can not convert value of type 'int' to expected argument type 'DispatchQueue.GlobalQueuePriority'
on creating dispatch async queue
DispatchQueue.global(priority: 0).async(execute: { () -> Void in })
DispatchQueue.global
expects the DispatchQueue.GlobalQueuePriority
enum, which is:
So in your case, you just write:
DispatchQueue.global(priority: .background).async(execute: { () -> Void in })
If you want the lowest priority.
A quick check reveals, that DispatchQueue.global(priority:_)
is deprecated in iOS 8.
DispatchQueue.global(qos: .background).async { }
Which gives you even more options to choose from:
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