Skip to content

Instantly share code, notes, and snippets.

@ksksue
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ksksue/a061bc652954064269da to your computer and use it in GitHub Desktop.
Save ksksue/a061bc652954064269da to your computer and use it in GitHub Desktop.
- (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