Skip to content

Instantly share code, notes, and snippets.

@jasdev
Last active March 23, 2016 00:33
Show Gist options
  • Save jasdev/ea842f5a4527dae5d9e3 to your computer and use it in GitHub Desktop.
Save jasdev/ea842f5a4527dae5d9e3 to your computer and use it in GitHub Desktop.
final class SampleViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let button = UIButton(type: .System)
// ...
button.addTarget(self, action: #selector(SampleViewController.buttonTapped(_:)), forControlEvents: .TouchUpInside)
view.addSubview(button)
}
@objc private func buttonTapped(button: UIButton) {
print("Selector method called!")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment