I have a pair of nested dispatch queues. For some reason the code inside the second one never gets fired:
dispatchGroupOne.notify(queue: .main) { [weak self] in
// Gets here
self?.dispatchGroupTwo.notify(queue: .main) {
// Doesn't get here
}
}
Even if I don't enter/leave dispatchGroupTwo
, it just never will get fired. Why is this? It works when it's not nested:
dispatchGroupOne.notify(queue: .main) {
// Gets here
}
dispatchGroupTwo.notify(queue: .main) {
// Gets here
}
However, I want to specifically perform code only after both of the dispatch groups have been fired.