Skip to content

Instantly share code, notes, and snippets.

@eroth
Last active March 17, 2019 18:23
Show Gist options
  • 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