How to use addTarget method in swift 3

后端 未结 10 1382
清酒与你
清酒与你 2020-11-29 02:20

here is my button object

    let loginRegisterButton:UIButton = {
    let button = UIButton(type: .system)
    button.backgroundColor = UIColor         


        
10条回答
  •  感情败类
    2020-11-29 02:47

    Try this

    button.addTarget(self, action:#selector(handleRegister()), for: .touchUpInside). 
    

    Just add parenthesis with name of method.

    Also you can refer link : Value of type 'CustomButton' has no member 'touchDown'

提交回复
热议问题