Skip to content

Instantly share code, notes, and snippets.

@mattlenz
Created August 19, 2012 03:02
Show Gist options
  • Save mattlenz/3391345 to your computer and use it in GitHub Desktop.
Save mattlenz/3391345 to your computer and use it in GitHub Desktop.
Recognize single and double tap gestures in RubyMotion
doubleTapRecognizer = self.whenTapped do |recognizer|
recognizer.numberOfTapsRequired = 2
recognizer.delaysTouchesBegan = true
p "Double tap"
end
singleTapRecognizer = self.whenTapped do |recognizer|
recognizer.numberOfTapsRequired = 1
recognizer.delaysTouchesBegan = true
recognizer.requireGestureRecognizerToFail(doubleTapRecognizer)
p "Single tap"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment