Skip to content

Instantly share code, notes, and snippets.

@deda9
Last active December 20, 2020 18:44
Show Gist options
  • Save deda9/c5d7c51e4cec0cee241f6fb4ae296002 to your computer and use it in GitHub Desktop.
Save deda9/c5d7c51e4cec0cee241f6fb4ae296002 to your computer and use it in GitHub Desktop.
How to create global dispatch queue
let dispatchQueue = DispatchQueue(label: "Background", attributes: .concurrent)
dispatchQueue.async {
for i in 0..<5 {
print("DispatchQueue X ", i)
}
}
dispatchQueue.async {
for i in 5..<10 {
print("DispatchQueue Y ", i)
}
}
dispatchQueue.async {
for i in 10..<15 {
print("DispatchQueue Z ", i)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment