I can not hide keyboard by pressing return key
- by chetan
I have tried this:
In .h file
@interface TouchLabelViewController : UIViewController<UITextFieldDelegate>
-(IBAction)hideKeyboard:(id)sender;
In .m File
-(IBAction)hideKeyboard:(id)sender{
[(UITextField*)sender resignFirstResponder];
}
And also tried this
in .h file
-(BOOL) textFieldShouldReturn:(UITextField *)textField;
in .m file
-(BOOL) textFieldShouldReturn:(UITextField *)textField{
[aTextField resignFirstResponder];
return YES;
}
But still whenever i touch return key it does not hide keyboard.