perlguy2

Gesture Recognizer Programmatically

Jun 29th, 2018
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.27 KB | None | 0 0
  1. override func viewDidLoad() {
  2.     super.viewDidLoad()
  3.  
  4.     let tap = UITapGestureRecognizer(target: self, action: #selector(doubleTapped))
  5.     tap.numberOfTapsRequired = 2
  6.     view.addGestureRecognizer(tap)
  7. }
  8.  
  9. @objc func doubleTapped() {
  10.     // do something here
  11. }
Advertisement
Add Comment
Please, Sign In to add comment