How to check if two asynchronous tasks are done with success
问题 What is the best and easiest way to implement this flowchart in a function? Right now I'm using two dispatch groups but I need to check if they're both done, and not only when they finish. If they are done then: friends array will have elements nicknames array will have elements note: FB is Facebook and FIR is Firebase database 回答1: You could do this using DispatchGroup . Try the following playground; import UIKit import XCPlayground let dispatchGroup = DispatchGroup.init() for index in 0...4