Skip to content

Instantly share code, notes, and snippets.

@stevencurtis
Last active May 20, 2020 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevencurtis/467a375d694594d9bbfe39262a2ea151 to your computer and use it in GitHub Desktop.
Save stevencurtis/467a375d694594d9bbfe39262a2ea151 to your computer and use it in GitHub Desktop.
completionhandlers
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