Skip to content

Instantly share code, notes, and snippets.

@thornpig
Created February 17, 2016 01:25
Show Gist options
  • Save thornpig/5eacf1a107256d195763 to your computer and use it in GitHub Desktop.
Save thornpig/5eacf1a107256d195763 to your computer and use it in GitHub Desktop.
UIGestureRecognizer block touches to the touched view by default
For example, tap gesture is often added to root view to dismiss keyboard on tap on the screen.
If the root view contains a table view, the tap gesture will block tap on the cell,
so didselectrowatindexpath will never be called. To let the gesturerecognizer pass touches to the view, add
gestureRecognizer.cancelsTouchesInView = NO; //default value is YES.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment