IQKeyboardManager hides keyboard when clicking on UITextField

I have two text fields. I use this code in textFieldDidBeginEditing, but it does not drop the keyboard.

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

    }

    else if (textField==textFieldTwo)
    {
        [[IQKeyboardManager sharedManager]resignFirstResponder]
    }
}
+4
source share
1 answer

It may help to try.

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

}

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

Source: https://habr.com/ru/post/1606711/


All Articles