How to add a target to a button using selector iOS swift?

Solution:


        Btn.addTarget(self, action: #selector(btnPressed), for: UIControlEvents.touchUpInside)

btnpressed function implementation will be like below

    func btnPressed() {

}

Comments

Popular posts from this blog

How to blink a button iOS swift?

Convert NsNumber, NSDate to String in iOS Swift

Parse the value from string value iOS swift