Skip to content

Instantly share code, notes, and snippets.

@ANSCoder
Last active February 4, 2018 12:32
Show Gist options
  • Save ANSCoder/2682b1412403fb22fcba22cad3e760a3 to your computer and use it in GitHub Desktop.
Save ANSCoder/2682b1412403fb22fcba22cad3e760a3 to your computer and use it in GitHub Desktop.
func asyncWork(){
let northZone = DispatchQueue(label: "perform_task_with_team_north")
let southZone = DispatchQueue(label: "perform_task_with_team_south")
northZone.async {
for numer in 1...3{ print("North \(numer)") }
}
southZone.async {
for numer in 1...3{ print("South \(numer)") }
}
}
//Call Async Task
asyncWork()
//OutPut
// North 1
// South 1
// North 2
// South 2
// North 3
// South 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment