Created
February 8, 2020 20:09
-
-
Save jeandavid/e4df11badfcd8feaaf30e2c35dfd100b to your computer and use it in GitHub Desktop.
Asynchronous Operation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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