Firebase & Swift: Asynchronous calls, Completion Handlers
问题 I have read up a lot on this subject but have still been stumped on this specific problem. I have many Firebase calls that rely on each other. This is a kind of simplified example of my code. I had trouble making it any shorter and still getting the point across: class ScoreUpdater { static let ref = Database.database().reference() var userAranking = Int? var userBranking = Int? var rankingAreceived = false var rankingBreceived = false var sum = 0 // Pass in the current user and the current