Nathanael Carper Nathanael Carper - 2 months ago 46
Swift Question

Code not working in Xcode 8

I just upgraded to Xcode 8 and Swift 3 yesterday. I have some code that has worked in Xcode 7, but now I get a warning in Xcode 8. I converted all my code to Swift 3, but this code still gives me a warning. Here's my code:

let priority = DispatchQueue.GlobalQueuePriority.default
DispatchQueue.global(priority: priority).async {

}


Here's a picture of the code and the warning I'm getting:

My problem

Answer

In Swift 3 it's pretty easy

DispatchQueue.global().async {

}

It's the short form of

DispatchQueue.global(qos: .default).async {

}

and .default is the default priority.