Q: Is it possible to pass a function as function argument in Swift 3?
To refactor my code, I want to have a global function. At the end of this function
Functions are first class in swift so you can pass them like so:
func getButton(_ myFunc: () -> Void, _ title: String) {
You need to specify the signature of the function in the type, i.e. parameter types and return type