- (void)viewDidLoad
{
[super viewDidLoad];
// 背景をキリックしたら、キーボードを隠す
UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeSoftKeyboard)];
[self.view addGestureRecognizer:gestureRecognizer];
}
// キーボードを隠す処理
- (void)closeSoftKeyboard {
[self.view endEditing: YES];
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme