Skip to content

Instantly share code, notes, and snippets.

@eroth
Last active March 17, 2019 18:23
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 eroth/d1895984bee8bee11c5f4ba83f3d0bc0 to your computer and use it in GitHub Desktop.
Save eroth/d1895984bee8bee11c5f4ba83f3d0bc0 to your computer and use it in GitHub Desktop.
func doSomethingClosure(_ completed: ((String) -> Void)) {
completed("We're using closures.")
}
doSomethingClosure { result in
print("result: \(result)")
}
// prints "result: We're using closures."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment