I want to use a method that wait for getting some thing and then do some thing else - I have a progressive in my app and want to use a function that waiting for progressive to be 100 percent and then that function execute - in generally I want to know how can I use a method that execute when another things happens - I used group method many times but this is more different(its some thing like listener)
let myGroup = DispatchGroup()
myGroup.enter()
//// Do your task
//// When you task complete
myGroup.leave()
myGroup.notify(queue: DispatchQueue.main) {
////// do your remaining work
}