Answers for "creating button programmatically swift"

0

swift create custom button programmatically

let button = UIButton(frame: CGRect(x: 20, y: 20, width: 200, height: 60))
 button.setTitle("Email", for: .normal)
 button.backgroundColor = .white
 button.setTitleColor(UIColor.black, for: .normal)
 button.addTarget(self, action: #selector(self.buttonTapped), for: .touchUpInside)
 myView.addSubview(button)



@objc func buttonTapped(sender : UIButton) {
                //Write button action here
            }
Posted by: Guest on June-03-2021
0

button click programmatically swift

button.sendActions(for: .touchUpInside)
Posted by: Guest on April-08-2020

Code answers related to "creating button programmatically swift"

Code answers related to "Swift"

Browse Popular Code Answers by Language