Last active
May 20, 2020 09:51
-
-
Save stevencurtis/467a375d694594d9bbfe39262a2ea151 to your computer and use it in GitHub Desktop.
completionhandlers
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
func outputString(str: String, completion: () -> ()) { | |
print (str) | |
completion() | |
} | |
func whenComplete() { | |
print ("complete") | |
} | |
outputString(str: "Hello, World!", completion: whenComplete) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment