Skip to content

Instantly share code, notes, and snippets.

@llinardos
Last active November 5, 2017 23:38
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 llinardos/0fc502c91f7fed9b328e5153d4cf6bc7 to your computer and use it in GitHub Desktop.
Save llinardos/0fc502c91f7fed9b328e5153d4cf6bc7 to your computer and use it in GitHub Desktop.
func aMethod() {
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(onTap(_:)))
aView.addGestureRecognizer(tapGesture)
}
@objc func onTap(_ gesture: UIGestureRecognizer) {
if (gesture.state == .ended) {
/* action */
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment