1

I've been fiddling with autofill for my signup flow on iOS, and I can't seem to get it to work perfectly.

I have a custom view that has a UITextField as one of the properties and I build all my text fields as instances of that custom view.

When I first made it, I didn't know I was supposed to conform to UITextInput to make autofill work, but autofill already almost worked great on everything except when textContentType = .newPassword. What was working was that I could tap the password manager when logging in and iOS would fill out BOTH the username & password fields for me, EXCEPT for the .newPassword field which didn't work at all or fill new passwords.

When I conformed to UITextInput, the .newPassword text field kinda worked in that it would let me open the password manager...however, all text fields now only fill out the selected UITextField, and never any other one. Ahhh I thought I had it!

This is far from desirable, since a user could create a password and only the username would be filled out, or vice versa. Plus, when logging in, you have to enter your password manager twice for the username + password.

Any tips for making this work? Thank you!

PS - It seemed that conforming to UITextInput was just boilerplate code anyway since I was already using a UITextField but just wrapped in a parent UIView...which was confusing but alright.

teradyl
  • 2,584
  • 1
  • 25
  • 34
  • Your question doesn't make much sense. You said your password field wasn't being filled out and then you contradict yourself by saying that it works. "Working great in that I could tap the password manager when logging in and iOS would fill out BOTH the username & password fields for me" <- That's what its supposed to do. What is the issue here? – Tad Dec 21 '21 at 03:23
  • It's very confusing I know. I have reworded it a bit to hopefully clarify. To your specific point it was working great EXCEPT for the `.newPassword` text type which wasn't working at all. – teradyl Jan 15 '22 at 03:12
  • You must make sure you have associated domains set up in order for iOS to suggest a randomly generated password. This also means you must have a working website that hosts some specific app data, more details here: https://developer.apple.com/documentation/xcode/supporting-associated-domains – Tad Jan 15 '22 at 08:18
  • Yes, I did all that. Still broken. I've also used a few apps on the app store that seem to have the same problem. I think it's an Apple bug. (problem I've ended up with is that when I use password manager to fill out form it only fills one at a time, but the password is recommending now) – teradyl Jan 17 '22 at 01:46

0 Answers0