Reputation: 3506
For some reason, in my app, the dismiss keybaord button on the lower right hand corner never works. I am able to use resignFirstResponder on the UITextField correctly, but if the user tries to us that button, nothing happens. any ideas?
- (BOOL)textFieldShouldEndEditing:(UITextField *)textField{
NSLog(@"shouldend");
return YES;
}
- (BOOL) textFieldShouldBeginEditing:(UITextField *)textField {
NSLog(@"should begin");
return YES;
}
Additional Info: This is a problem for the entire app. The button never works in any textField in my app.
Upvotes: 0
Views: 293
Reputation: 48398
You probably need to implement the UITextFieldDelegate
method – textFieldShouldEndEditing:
:
- (BOOL)textFieldShouldEndEditing:(UITextField *)textField {
return YES;
}
To test what's going on, you can also put in simple NSLog
s in – textFieldDidBeginEditing:
and – textFieldDidEndEditing:
. This will tell you whether to gesture is being received or not.
Upvotes: 1