title: Wait for all Operations in queue to finish before performing task
body: <p>I have an Operation subclass and Operation queue with maxConcurrentOperationCount = 1.</p>
  
  <p>This performs my operations in a sequential order that i add them which is good but now i need to wait until all operations have finished before running another process.</p>
  
  <p>i was trying to use notification group but as this is run in a for loop as soon as the operations have been added to the queue the notification group fires..  How do i wait for all operations to leave the queue before running another process?</p>
  
  <pre><code>for (index, _) in  self.packArray.enumerated() {
  
      myGroup.enter()
      let myArrayOperation = ArrayOperation(collection: self.outerCollectionView, id: self.packArray[index].id, count: index)
      myArrayOperation.name = self.packArray[index].id
      downloadQueue.addOperation(myArrayOperation)
      myGroup.leave()
  
  }
  
  myGroup.notify(queue: .main) {
   // do stuff here
  }
  </code></pre>