0

I am encountering the issue that I would like to call a function when another firebase call is done entirely.

The app loads posts like usual apps do and as soon as its done loading with every single post, I would like to call the next function because calling both leads to terrible usage.

I don't want to use dispatchQueue, because in case there is weak internet for the person it would lead again to the issue of both functions working simultaneously. I can only make it happen to start the function call when the first post is loaded but for me its a necessity that every post is fully loaded before.

Any (general) advice?

Zash__
  • 293
  • 4
  • 16
  • Have you tried using DispatchGroup()? This should allow you to be notified when all posts have been loaded. – chickenparm Feb 12 '18 at 19:05
  • Have a look at - https://stackoverflow.com/questions/48689441/how-to-pipeline-several-request-to-firebase-in-order-to-fetch-data-from-multiple/48690376#48690376 – Chris Edgington Feb 13 '18 at 14:38
  • well thanks that worked exactly as I wanted! I upvoted your answer (y) – Zash__ Feb 13 '18 at 14:44

0 Answers0