-(void) textFieldShouldReturn:(UITextField *)textField
{
[textField resignFirstResponder];
}
And in the header file (.h)
-(void)textFieldShouldReturn:(UITextField *)textField
2. Add target to the textField:
txtField.delegate = self;
[txtField addTarget:self action:@selector(textFieldShouldReturn:)
forControlEvents:UIControlEventTouchCancel];
That's it! Test it out. Hope you find this useful.
No comments:
Post a Comment