This is how you hide the UITextField when you press the back button:
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return YES;
}
This is how you hide when you press UIButton:
- (void)hideTextField:(UITextField *)textField {
[textField resignFirstResponder];
}