Skip to content

Instantly share code, notes, and snippets.

@lordhumunguz
Last active August 29, 2015 14:25
Show Gist options
  • Save lordhumunguz/ef0ba07f50a8f4e79a6c to your computer and use it in GitHub Desktop.
Save lordhumunguz/ef0ba07f50a8f4e79a6c to your computer and use it in GitHub Desktop.
[iOS] Add Tap Gesture Recognizer
// confirm to the tap gesture recognizer delegate
func addTapGestureRecognizerForPausingWorkout() {
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: "workoutVideoTapped:")
tapGestureRecognizer.numberOfTapsRequired = 1
tapGestureRecognizer.delegate = self
self.view.addGestureRecognizer(tapGestureRecognizer)
}
func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer otherGestureRecognizer: UIGestureRecognizer) -> Bool { return true }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment