Skip to content

Instantly share code, notes, and snippets.

@jeandavid
Created February 8, 2020 20:19
Show Gist options
  • Save jeandavid/8d4d41c34dabd19074c25c6623ee19d6 to your computer and use it in GitHub Desktop.
Save jeandavid/8d4d41c34dabd19074c25c6623ee19d6 to your computer and use it in GitHub Desktop.
Synchronous execution of two operations
let syncOperation = SyncOperation()
let asyncOperation = AsyncOperation()
let queue = OperationQueue()
queue.addOperations([syncOperation, asyncOperation], waitUntilFinished: true)
print("Done")
// Outputs "Executing" twice then "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment