Skip to content

Instantly share code, notes, and snippets.

@danmartyn
Last active December 15, 2015 20:09
Show Gist options
  • Save danmartyn/5316466 to your computer and use it in GitHub Desktop.
Save danmartyn/5316466 to your computer and use it in GitHub Desktop.
// Create a UITapGestureRecognizer and add it to the view
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
tap.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:tap];
// In the handleTap Method add
- (void)handleTap:(UITapGestureRecognizer *)tap
{
[self.view endEditing:YES];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment