Skip to content

Instantly share code, notes, and snippets.

@gunantosteven
Created April 22, 2020 12:37
Show Gist options
  • Save gunantosteven/9884b1290edde0ae98e270b3b63718e3 to your computer and use it in GitHub Desktop.
Save gunantosteven/9884b1290edde0ae98e270b3b63718e3 to your computer and use it in GitHub Desktop.
Make Difference between Double Tap and Single Tap in UIView
let tapImagePhoto = UITapGestureRecognizer(target: self, action: #selector(YourClass.tapImagePhoto))
tapImagePhoto.numberOfTapsRequired = 2
videoPlayerSuperView.addGestureRecognizer(tapImagePhoto)
let tapPlayPause = UITapGestureRecognizer(target: self, action: #selector(YourClass.tapPlayPause))
tapPlayPause.numberOfTapsRequired = 1
videoPlayerSuperView.addGestureRecognizer(tapPlayPause)
tapPlayPause.require(toFail: tapImagePhoto2) // important code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment