Skip to content

Instantly share code, notes, and snippets.

@pgpt10
Last active October 5, 2017 06:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pgpt10/5ce5fa81a23f68d37da7a691b16a231e to your computer and use it in GitHub Desktop.
Save pgpt10/5ce5fa81a23f68d37da7a691b16a231e to your computer and use it in GitHub Desktop.
override func viewDidLoad()
{
super.viewDidLoad()
let button = UIButton(frame: CGRect(x: 0, y: 0, width: 50, height: 50))
button.addTarget(self, action: #selector(buttonClick), for: .touchUpInside)
}
@objc func buttonClick() //Add @objc in method definition
{
//Some code here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment