Waiting For All The Threads To Finish Swift

[Solved] Waiting For All The Threads To Finish Swift | Swift - Code Explorer | yomemimo.com
Question : waiting for all the threads to finish swift

Answered by : kanishk-dhindsa

let group = DispatchGroup()
group.enter()
DispatchQueue.global(qos: .userInitiated).async { // Do work asyncly and call group.leave() after you are done group.leave()
}
group.notify(queue: .main, execute: { // This will be called when block ends
})

Source : https://stackoverflow.com/questions/47041491/swift-wait-for-closure-thread-to-finish | Last Update : Sat, 04 Jun 22

Answers related to waiting for all the threads to finish swift

Code Explorer Popular Question For Swift