Skip to content

Instantly share code, notes, and snippets.

@Adam0101
Created January 24, 2011 03:39
Show Gist options
  • Save Adam0101/792797 to your computer and use it in GitHub Desktop.
Save Adam0101/792797 to your computer and use it in GitHub Desktop.
Example of a simple way to dismiss the iphone keyboard when a user clicks anywhere but the textfield
- (void)touchesEnded: (NSSet *)touches withEvent: (UIEvent *)event {
for (UIView* view in self.view.subviews) {
if ([view isKindOfClass:[UITextField class]])
[view resignFirstResponder];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment