Set a PasswordField to secureTextEntry give me a strange behaviour
This happens when the system's user doesn't have iCloud Keychain enabled. As will often be the case on the Simulator :)
I ran into this on the simulator and came here. Tried it on my phone (where iCloud Keychain is enabled), and got this instead:
[AutoFill] Cannot show Automatic Strong Passwords for app bundleID:
your.bundle.id due to error: Cannot save passwords for this app. Make
sure you have set up Associated Domains for your app and AutoFill
Passwords is enabled in Settings
So this is Apple's cool AutoFill feature. There are some steps described here that should enable that.
Cannot show Automatic Strong Passwords for app bundleID when signup
Automatic Strong Passwords suggestion works if user has enabled the iCloud keychain in its iPhone. I resolved this error by doing the following steps
How to enable iCloud keychain
- Go to the Setting
- Tap on UserName (Apple Id)
- Tap on iCloud
- Tap on keychain
- Enable iCLoud Keychain
Change UIFont in secure UITextField strange behaviour in iOS7
As a couple people pointed out, it appears secure text fields don't always play well with custom fonts. I worked around this by using the UITextField's UIControlEventEditingChanged
to monitor for changes to the textfield and set it to the system font (with the normal looking bullet points) when anything is entered, else use my custom font.
This allows me to keep using my custom font for the textfield placeholder and still look good when the password is entered. The characters that show one-at-a-time while being entered will be the system font, but I'm okay with that.
In viewDidLoad:
[self.passwordTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
Now add a textFieldDidChange method:
- (void)textFieldDidChange:(id)sender
{
UITextField *textField = (UITextField *)sender;
if (textField == self.passwordTextField) {
// Set to custom font if the textfield is cleared, else set it to system font
// This is a workaround because secure text fields don't play well with custom fonts
if (textField.text.length == 0) {
textField.font = [UIFont fontWithName:@"OpenSans" size:textField.font.pointSize];
}
else {
textField.font = [UIFont systemFontOfSize:textField.font.pointSize];
}
}
}
Native UITextField Secure Text Entry forces English (US) keyboard
This was truly an iOS bug => corrected in iOS 12.1
UITextField with secure entry, always getting cleared before editing
Set,
textField.clearsOnBeginEditing = NO;
Note: This won't work if secureTextEntry = YES. It seems, by default, iOS clears the text of secure entry text fields before editing, no matter clearsOnBeginEditing is YES or NO.
Related Topics
Dragging Scnnode in Arkit Using Scenekit
How to Retrieve Messages Logged with Os_Log from iPad/Iphone
Trouble Creating Xmpp Muc Room: Code 503 (Service Unavailable)
How to Activate Tcp Keepalive on Apple iOS Devices
How to Add a Character at a Particular Index in String in Swift
Swift Add Footer View in Uitableview
Ios/Ipados Safari Push API Support
Customize Navigation Bar with Title View
How to Get the Result Value of Alamofire.Request().Responsejson in Swift 2
Core Data Store Included in App Bundle
How to Customize Uirefreshcontrol with Different Image and Position
View Controller Responds to App Delegate Notifications in iOS 12 But Not in iOS 13
How to Draw Inside the Black Edges in iOS Sdk with Opengl Es