Created
August 16, 2016 12:12
-
-
Save raindev/ebc38bc64e0d145a6c3b064b16058088 to your computer and use it in GitHub Desktop.
External function parameters in Swift
This file contains hidden or 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 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