UITextField content type password some time change the state while entering password - ios

I am using Xocde - 10.1 and added a UITextField in storyboard
Properties of the text field are shown on the following screen shot -
When I'm entering a password, it shows me a warning 'Strong password' and user interaction is being disabled for the text field.
Additional explanation - the text field works fine most of the time while I am entering the text inside it. But sometimes a text that should be hidden is being shown in the left side of the text field (like on screenshot above). If I reload the view, then I will be able to edit it. Otherwise - I won't be able to continue editing it.

This is the iOS 12 Password AutoFill behavior. I'd try removing the ContentType of Password on the field for simulator only if it's causing you problems there. On a device I suspect you'd get the expected behavior and be able to interact as outlined here.
You may also have to move the show/hide password image out of the text field if you want to support strong password autofill.

Related

Handling (or disabling) Memoji in InputBarAccessoryView TextField

I'm building a chat app using MessageKit, Firebase and InputBarAccessoryView pods.
I've found out that when I input a Memoji (aka sticker) in the textfield of the InputBar and press the "send" button, in the database the Memoji will be saved as "\n", which of course will be rendered as a blank bubble in the receiving user screen. The issue is exclusive to Memoji, regular emojis works fine.
Before sending, I already check if the user is trying to send an empty string, and if the case the message is not sent at all to the database, but I don't know how to check if a Memoji is being input.
Plus, in the textbar the Memoji is rendered awfully, see pic here, so the best solution would be cutting the problem at its roots and removing the option to input Memoji in the textfield or directly removing them from the keyboard.
I'm searching for a way to to remove Memoji from users keyboard, or to handle at best these issues, but i've found nothing googling.
Memojis work this way: when selected from the keyboard, they are pasted into the TextView.
So i just found a decent solution directly from the InputBar API:
messageInputBar.inputTextView.isImagePasteEnabled = false
This removes the possibility to paste images in the TextView, and alongside Memojis are removed from the keyboard.

iOS 13 autofill not filling UITextField until user manually focuses it

Basic description: I have a modal dialog that appears with two UITextFields with their content types set correctly for autofill, the keyboard appears on textfield focus, with the iOS autofill prompt. The autofill action sheet appears, and I select the correctly identified credential, the action sheet dismisses, returning my app to the foreground, yet the credentials are not entered into the text fields until the user manually focuses them, at which point the system keyboard is re-shown and the credentials are entered correctly.
Environment:
Xcode 11.3
iOS Sim 13.3 (problem was originally reported from a physical device with 13.3)
Using PanModal from Slack (https://github.com/slackhq/PanModal) with some customizations added to handle keyboard showing and presenting vc animations (https://github.com/mgray88/PanModal/tree/toc.1)
Text fields are custom subclasses of UITextField
Scene support is explicitly disabled
Strange error message reported in the console, which excessive amount of Googling has not yielded any answers:
Keyboard cannot present view controllers (attempted to present <UIKeyboardHiddenViewController_Autofill: 0x7fe5d37bd640>)
This appears upon selecting the Autofill button on the keyboard toolbar
Followed by textFieldShouldEndEditing and textFieldCanResignFirstResponder, which is to be expected
The autofill action sheet presents, and I select the desired credentials
Action sheet dismisses, returning focus to the app
At this point, the credentials should have been entered into the text fields
HOWEVER, the credentials are not entered into the text fields until the user manually selects one of them
None of the text field delegate methods are fired until manual focus
None of the first responder methods are fired
Example project which demonstrates this issue: https://github.com/mgray88/AutofillTest

How do you normally show this "Passwords" button on the iOS keyboard?

Bit of a strange question: we are working on an iOS app made with a 3rd-party engine (Unity). We've encountered what appears to be a bug in the engine - randomly, when the soft keyboard is shown, a "Passwords" button appears at the top of the keyboard. Tapping this button brings up a list of websites that you've previously saved passwords for.
I've never seen this button in any other circumstance and have no idea what causes it to appear. What I'm looking for right now is information about this button - any API docs about it, what Objective-C / Swift code you'd normally use to show it, etc. I'm hoping this additional information will make it easier to find a workaround or at least file a bug report with Unity.
In iOS apps you get automatically this password autofill button on the top of the keyboard if you set the textContentType property of UITextField to any of these:
• username,
• password,
• newPassword,
• oneTimeCode
More about this you can read on this link: Enabling Password AutoFill on a Text Input View
Hope it helps.

AutoFill username with number pad keyboard seems broken in iOS 12 (works in iOS 11)

My view has just 2 text fields, for username and password. Content type is specified accordingly. I want to use phone numbers as usernames, so I chose "Number Pad" as keyboard type for username field.
The issue is that when I run this on iOS 12, when first selecting username field, the autofill control does not appear above keyboard. If then select password field, it appears. Then I can select username field again and autofill control remains and is available this time.
If I change username keyboard type to default, the issue goes away.
In iOS 11 this issue does not exist.
Anyone knows why it is so?

Blackberry input field that mimics the input field of Android

I'm trying to make a login screen for Blackberry with input fields for username and password that look like the the editText field of android. Basically, there should be a well defined background and default prompt text in a different color when no text has been input. Unfortunately, I couldn't find a default field provided by blackberry. I'm currently using an EditField and a PasswordEditField with BorderFactory to provide the demarcation. Is anyone aware of such libraries or some other open source efforts by someone to do so? Please point me to any tutorial, etc too.
Thanks!
You will need to write your own custom field which extends EditField.
http://docs.blackberry.com/en/developers/deliverables/11958/Create_a_custom_field_508117_11.jsp
My suggestions are:
Override the Field.paint() method to place the label inside the text box (rather than to the left of it which is the default behaviour). This is where your instruction to the user can go, ie the 'Username' or 'Password' text.
Override the Field.onFocus() method to remove the instruction from the text box. Conversely override the Field.onUnfocus() method to add it back in if the user moves to another text box without entering any text.

Resources