Skip to content

Instantly share code, notes, and snippets.

@raindev
Created August 16, 2016 12:12
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 raindev/ebc38bc64e0d145a6c3b064b16058088 to your computer and use it in GitHub Desktop.
Save raindev/ebc38bc64e0d145a6c3b064b16058088 to your computer and use it in GitHub Desktop.
External function parameters in Swift
func printMathResult(mathFunction: (Int, Int) -> Int, _ a: Int, _ b: Int) {
print(mathFunction(a, b))
}
printMathResult({$0 + $1}, a: 2, b: 3)
printMathResult({$0 + $1}, 2, 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment