Skip to content

Instantly share code, notes, and snippets.

@deda9
Created June 7, 2018 23:02
Show Gist options
  • Save deda9/bef4906eeaed9801215241c582799672 to your computer and use it in GitHub Desktop.
Save deda9/bef4906eeaed9801215241c582799672 to your computer and use it in GitHub Desktop.
How to create NSOperationQueue
let operationQueue1 = OperationQueue.init()
let operation1 = BlockOperation.init()
operation1.addExecutionBlock {
print("I am operation execution block injected in the operation1")
}
operationQueue1.addOperation(operation1)
operationQueue1.addOperation {
print("I am operation execution block injected direct to queue by operation")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment