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

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift