title: Why Dispatch Group Notify get's called twice?
body: <p>I'm trying to get my app to use dispatch groups to make sure all invites have been sent before continuing. I thought the <code>notify</code> callback only got called once all <code>enters</code> have a matching <code>leave</code> but mine appears to be getting called multiple times, here's my code:</p>
  
  <pre><code>    for invite in invites {
          dispatchGroup.enter()
          let ref = FIRDatabase.database().reference().child("users").child(invite.id).child("invites")
          print(invite)
          ref.updateChildValues([name: nameTextField.text!]) { (error, ref) -&gt; Void in
              dispatchGroup.leave()
  
              dispatchGroup.notify(queue: DispatchQueue.main, execute: {
                  print("YOYOYO")
              })
          }
      }
  </code></pre>
  
  <p>In my console I'm seeing 2 "YOYOYO"s which confused me. Can anybody let me know if I'm doing this incorrectly or are my assumptions wrong?</p>