title: Swift DispatchGroup notify before task finish
body: <p>I'm using <code>DispatchGroup</code> to perform a task, but <code>group.notify</code> is being called before the task is completed.</p>
  
  <p>My code:</p>
  
  <pre><code>let group = DispatchGroup()
  let queueImage = DispatchQueue(label: "com.image")
  let queueVideo = DispatchQueue(label: "com.video")
  queueImage.async(group: group) {
      sleep(2)
      print("image")
  }
  
  queueVideo.async(group: group) {
      sleep(3)
      print("video")
  }
  
  group.notify(queue: .main) {
      print("all finished.")
  }
  </code></pre>
  
  <p>Logs:</p>
  
  <pre><code>all finish.
  image
  video
  </code></pre>