mamaral / Neon

A powerful Swift programmatic UI layout framework.
MIT License
4.58k stars 389 forks source link

Button click action is not working #54

Closed ebubekirguler closed 7 years ago

ebubekirguler commented 7 years ago

Hi, In TwitterProfileExampleViewController, i add a click event to cameraButton which is an UIButton, but the click action is not working. Can you help me please. thanks

` cameraButton.setImage(UIImage(named: "camera"), for: .normal) cameraButton.addTarget(self, action: #selector(buttonAction), for: .touchUpInside)

func buttonAction(sender: UIButton!) {
    var btnsendtag: UIButton = sender
    if btnsendtag.tag == 1 {
        //do anything here
    }
}

`

mamaral commented 7 years ago

Do you need to add a colon to the selector code because your function takes a param? Been a bit since I wrote that in swift and I'm away from a computer at the moment.

#selector(buttonAction:)

mamaral commented 7 years ago

I'm closing this now as this is very unlikely related to Neon, but can help if you need further help.