Syed Ismail Ahamed
Syed Ismail Ahamed

Reputation: 349

IQKeyboardManager hides keyboard when tapped on UITextField

I have two text fields. I am using this code in textFieldDidBeginEditing, but it's not dismissing the keyboard.

-(void)textFieldDidBeginEditing:(UITextField *)textField {
    if(textField==textFieldOne)
    {

    }

    else if (textField==textFieldTwo)
    {
        [[IQKeyboardManager sharedManager]resignFirstResponder]
    }
}

Upvotes: 4

Views: 2893

Answers (1)

baydi
baydi

Reputation: 1003

This might help Try

-(void)textFieldDidBeginEditing:(UITextField *)textField {
if(textField==textFieldOne)
{

}

else if (textField==textFieldTwo)
{
[self.view endEditing:YES];
}
}

Upvotes: 2

Related Questions