How to use addTarget method in swift 3

后端 未结 10 1378
清酒与你
清酒与你 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:59

    Try this with Swift 3

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

    Good luck!

提交回复
热议问题