In my project I have several pages with many UITextField-s. So I figured it would be better to create an utility method named hideKeyboard which would work in any case. Here is my solution, but actually something in this code doesn't feel right. Is there any better solutions for this?
+(void) hideKeyBoard {
UITextField* t = [[UITextField alloc] initWithFrame:CGRectNull];
[[UIApplication sharedApplication].keyWindow addSubview:t];
[t becomeFirstResponder];
[t resignFirstResponder];
[t removeFromSuperview];
}