I'm having issues with toggling the secureEntry
property on UITextField
. When the property is toggled, the characters are resized, but the cursor stays in the wrong place:
Here is my workaround:
textField.secureTextEntry = YES;
UITextRange *textRange = textField.selectedTextRange;
textField.selectedTextRange = nil;
textField.selectedTextRange = textRange;
Disable and then Enable the UITextField also help, but it will suddenly change my soft keyboard from one to another
After setting textField secureEntry
property NO
, you need to call becomeFirstResponder
method its works for me...
Try this
textField.secureTextEntry = NO;
if (textField.isFirstResponder){
[textField becomeFirstResponder];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With