Skip to content

Instantly share code, notes, and snippets.

@olbrichj
Created January 29, 2018 21:42
Show Gist options
  • Save olbrichj/5b5875b2ef583ba29a307bd4d39b83bd to your computer and use it in GitHub Desktop.
Save olbrichj/5b5875b2ef583ba29a307bd4d39b83bd to your computer and use it in GitHub Desktop.
let op1 = Operation()
op1.name = "Operation1"
OperationQueue.main.addOperations([op1], waitUntilFinished:false)
let operations = OperationQueue.main.operations
operations.map { op in
if op.name == "Operation1" {
op.cancel()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment