IOS keyboard introduces selector

In iOS, where can I connect the selector to the keyboard, enter the button?

Greetings

+4
source share
3 answers

Use UITextFieldDelegate -Protocol and implement:

-(BOOL)textFieldShouldReturn:(UITextField *)textField

See the UITextFieldDelegate Reference .

+9
source

In the textFieldShouldReturn method specified in Till, you would do

 [textField resignFirstResponder]; 

to hide the keyboard.

+4
source

Add a UITextFieldDelegate to your .h and add the following code to your .m:

 -(BOOL)textFieldShouldReturn:(UITextField *)textField{ [textField resignFirstResponder]; return YES; }; 
+1
source

All Articles