I have a situation where I need to wait for a group of tasks to complete before executing some UI rendering code.
Some of these tasks are network requests which will always complete and leave the dispatch group. Some however, are not network requests and may or may not be completed. In the case where one task is not completed and the calls to leave never balance the calls to enter, the DispatchGroup is never de-allocated.
Is there a way around this using DispatchGroup? Or should I just implement a simple counter myself.