Skip to content

Instantly share code, notes, and snippets.

@dmytro-anokhin
Created May 14, 2018 13:53
Show Gist options
  • Select an option

  • Save dmytro-anokhin/f25c6d25537d886681e07a8ad2734f94 to your computer and use it in GitHub Desktop.

Select an option

Save dmytro-anokhin/f25c6d25537d886681e07a8ad2734f94 to your computer and use it in GitHub Desktop.
let group = DispatchGroup()
for task in tasks {
group.enter()
task.run({ task in
group.leave()
})
}
group.notify(queue: DispatchQueue.main) {
print("All tasks completed")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment