Skip to content

Instantly share code, notes, and snippets.

@jeandavid
Created February 8, 2020 20:09
Show Gist options
  • Save jeandavid/e4df11badfcd8feaaf30e2c35dfd100b to your computer and use it in GitHub Desktop.
Save jeandavid/e4df11badfcd8feaaf30e2c35dfd100b to your computer and use it in GitHub Desktop.
Asynchronous Operation
class AsyncOperation: Operation {
override func main() {
DispatchQueue.global().async {
print("Executing")
}
}
}
let operation = AsyncOperation()
operation.start()
print("Done")
// May output "Executing" then "Done" or "Done" then "Executing"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment