Created
June 14, 2020 08:48
-
-
Save stevencurtis/60020d823085de81b9e2ddde0986f180 to your computer and use it in GitHub Desktop.
addmathescaping
This file contains 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
let add: (Int,Int) -> () = { a, b in | |
print("Result \(a + b)") | |
} | |
func mathForOneAndTwo(firstNum: Int, secondNum: Int, action: @escaping (Int,Int) -> Void) { | |
DispatchQueue.main.asyncAfter(deadline: .now() + 2, execute: { | |
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