Is it possible to declare an empty function as a variable in Swift?

Viewed 3855

Is it possible to do something like this, and create an empty function that will later be assignable, because I keep getting an error where i can't call the function that was assigned this is the closest I have gotten

fileprivate class actionButton: UIButton{
    var functo = ()
    func tapped(functoCall: () ->Void){
        self.functo()
    }
}

this buttons initialized in a function which takes a function as a parameter and passes it on to this button which is a descendent of the class specified above

    button.functo = funcToCall()
    button.addTarget(self, action: #selector(yes.tapped(functoCall:)), for: .touchDown)

the issue i get is when i try to call self.functo() i get cannot call non-function type

1 Answers
Related