Created
March 14, 2021 16:18
-
-
Save fredriccliver/c03f1a7ea726a627ff578bd2a5b213f2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let asyncQueue = DispatchGroup() | |
for person in people{ | |
asyncQueue.enter() | |
// "checkIdentity" is a Async function which takes networking resource and consume a bit of time. | |
self.checkIdentity(person) { (err) in | |
if(err != nil){ | |
print(err) | |
} | |
asyncQueue.leave() | |
} | |
} | |
asyncQueue.notify(queue: .main) { | |
self.sendAllPeople() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment