apex
apex

Reputation: 153

ios - Disabling key or hiding keyboard in Objective-C

I want to disable the return key on the keyboard of my app while I am performing a certain task, and then enable it again after the task is finished. Is this possible? If not can I disable the entire keyboard or just hide it for this period of time?

Upvotes: 0

Views: 560

Answers (2)

Prakash Shaiva
Prakash Shaiva

Reputation: 1095

To hide Keyboard use

[textField resignFirstResponder]

and to Show Keyboard use

[textField becomeFirstResponder]

Upvotes: 0

sschunara
sschunara

Reputation: 2285

For hiding keyboard you can do [textField/textView resignFirstResponder]; for that text textfield or text view. Also you can call [self.view endEditing:YES]; if you want to hide keyboard at any stage of app.

Upvotes: 1

Related Questions