Last active
August 29, 2015 14:10
-
-
Save ksksue/a061bc652954064269da to your computer and use it in GitHub Desktop.
This file contains 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)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// 背景をクリックしたら、キーボードを隠す | |
UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeKeyboard)]; | |
gestureRecognizer.cancelsTouchesInView = NO; | |
[self.view addGestureRecognizer:gestureRecognizer]; | |
} | |
// キーボードを隠す処理 | |
- (void)closeKeyboard { | |
[self.view endEditing: YES]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment