-
-
Save trevorwang/4211690 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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