title: Firebase asynchronous function, what's in the background queue and what's not
body: <p>Lets say I have this  </p>
  
  <pre><code>// a bunch of code...  
  FIRDatabase.database.reference.child("somechild").observeSingleEventOfType(.Value, withBlock{(snapshot) in   
  
  //some code inside of the completion handler})
  </code></pre>
  
  <p>Please don't read too much into the code snippet asking for more code, I only require a short answer. Where it says, "a bunch of code", assume that its actually some code that's on the MAIN queue. Now, when I write down the observeSingleEvent Firebase completion handler, my analysis on it is this. </p>
  
  <ol>
  <li><p>observeSingleEvent fetches the snapshot on a background queue as to not block UI thats on the main queue. </p></li>
  <li><p>Once it fetches the snapshot, the block of code after "in" is now back to the MAIN queue, so its fine to put any UI related code in there.</p></li>
  </ol>
  
  <p>My whole app is based on this reasoning, so if I'm incorrect, please tell me what's actually going on. </p>