Skip to content

Commit 1ec347f

Browse files
Enable iOS Password AutoFill on the legacy login form (#6)
Set textContentType (username / password) on the xAuth login fields so iOS recognises the form and offers saved logins and the Passwords key in the QuickType bar — the native equivalent of tagging a web form's inputs with autocomplete=username / current-password.
1 parent be73dfc commit 1ec347f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

LegacyLogin/BHTLegacyLoginViewController.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,13 @@ - (void)viewDidLoad {
235235

236236
self.userField = [self field:@"Username, email or phone" secure:NO];
237237
self.userField.keyboardType = UIKeyboardTypeEmailAddress;
238+
// Tag the fields so iOS Password AutoFill recognises the form and offers
239+
// saved logins / the Passwords key in the QuickType bar (the native
240+
// equivalent of autocomplete=username / current-password on a web form).
241+
self.userField.textContentType = UITextContentTypeUsername;
238242

239243
self.passField = [self field:@"Password" secure:YES];
244+
self.passField.textContentType = UITextContentTypePassword;
240245

241246
self.actionButton = [UIButton buttonWithType:UIButtonTypeSystem];
242247
[self.actionButton setTitle:@"Log in" forState:UIControlStateNormal];

0 commit comments

Comments
 (0)