I want to have function as variable in function declaration and than call that variable within declared function. How to do it in Swift?
Pseudo code:
let something = 0
func one() {
print("one")
}
// Definition
func two( funcVariable: Void, number: Int) {
print("\(number)")
funcVariable() // here I want to call variable function
}
// Call
two(funcVariable: one(), number: somethhing)
How to do it?
Example code appreciated.