user5227448
user5227448

Reputation:

How to add action to "done" button keyboard?

enter image description here

I have a quiz. I want to go to the next question was carried out using the "done" button on the keyboard. How can i do this?

Upvotes: 2

Views: 5254

Answers (2)

MoLowKey
MoLowKey

Reputation: 1142

you can do this by add this Line for set Type of return key type :

 txtField.returnKeyType = UIReturnKeyDone;

and for handle action you can do like this :

- (BOOL)textFieldShouldReturn:(UITextField *)textField
 {
    // you can handle here
    return YES;
 }

Upvotes: 2

Atul
Atul

Reputation: 1

Implement delegate of texfield named textfield should return an add code to show your next question. And if you have requirement such like that for each question keyboard should be open, then your code could be like this, first you have to resignfirst responder and your next quiz question become the first responder and so on.

Upvotes: 0

Related Questions