iOS How to hide keyboard

When tapping UITextField, keyboard is coming up.
While editing, it’s fine. But after that, it is very obstacle, isn’t it.

How to hide

Call resignFirstResponder of UITextField

[self.titleField resignFirstResponder];  // self.titleField is UITextField

Where should we add?

In my opinion, parent view of UITextField is one of good place.

UITapGestureRecognizer *tapView = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(resignKeyboard:)];
[view addGestureRecognizer:tapView];   // view is UIView
-(void)resignKeyboard:(UITapGestureRecognizer *)recognizer {
    [self.titleField resignFirstResponder];