Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I have two buttons leftBtn and rightBtn respectively, and one UITextField.
When user taps on leftBtn, I have code below,
[textField resignFirstResponder];
textField.autocorrectionType = UITextAutocorrectionTypeNo;
when user taps on rightBtn, I have following code,
[textField resignFirstResponder];
textField.autocorrectionType = UITextAutocorrectionTypeYes;
So when right button is tapped I see autocorrect and when left button is tapped I don't see autocorrect.
It works fine but when from right button I pick text from autocorrect and then if I switch to left button it shows keyboard with autocorrect until I have autocorrect text entered in my textfield.
It bypass the line
textfield.autocorrectionType = UITextAutocorrectionTypeYes;
But doesn't hide autocorrect until I remove character entered.
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.