viewDidload あたりに以下を追加
// 背景をタップしたら、キーボードを隠す UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideKeyboard)]; [self.view addGestureRecognizer:gestureRecognizer];
メソッドを定義 resign
#pragma mark - Control Action - (void)hideKeyboard{ [self.view endEditing: YES]; }