Skip to content

Instantly share code, notes, and snippets.

@stevencurtis
Created June 14, 2020 08:45
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/06b367d19c49a4e17b6c240db461338b to your computer and use it in GitHub Desktop.
Save stevencurtis/06b367d19c49a4e17b6c240db461338b to your computer and use it in GitHub Desktop.
addmath
let add: (Int,Int) -> () = { a,b in
print("Result \(a + b)")
}
func mathForOneAndTwo(firstNum: Int, secondNum: Int, action: (Int,Int) -> Void) {
action(firstNum,secondNum)
}
mathForOneAndTwo(firstNum: 1, secondNum: 2, action: add)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment