change a variable value in swift from a function swift code example Example: swift function in a variable var pendingFunction: ((Double, Double) -> Double)