Last Updated: February 25, 2016
·
1.142K
· chintan-dave

Hide input view(like keyboard) without first responder.

Some time we need to hide input view without using [firstResponder resignFirstResponder].
Like we have 5 to 10 textField and we don’t know which is first responder or we want to hide input view from part of code which can not access first responder. Or some time first responder is in there party library. In all this case we can use following line to hide input view.

[[[UIApplication sharedApplication] keyWindow] endEditing:YES];