Skip to content

Instantly share code, notes, and snippets.

@olbrichj
Created January 29, 2018 21:35
Show Gist options
  • Save olbrichj/66cbd2d88ab4785f34424548cb71bdcd to your computer and use it in GitHub Desktop.
Save olbrichj/66cbd2d88ab4785f34424548cb71bdcd to your computer and use it in GitHub Desktop.
class GroupOperation: AsyncOperation {
let queue = OperationQueue()
var operations: [AsyncOperation] = []
var errors: [Error] = []
override func execute() {
print("group started")
queue.addOperations(operations, waitUntilFinished: true)
print("group done")
}
func finish(withError errors: [Error]) {
self.errors += errors
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment