4

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]
    }
}
Tamás Sengel
  • 55,884
  • 29
  • 169
  • 223
Syed Ismail Ahamed
  • 349
  • 1
  • 6
  • 17

1 Answers1

2

This might help Try

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

}

else if (textField==textFieldTwo)
{
[self.view endEditing:YES];
}
}
baydi
  • 1,003
  • 6
  • 11