From 386efd632bf20d7a7a4175f724d1caac9853a7a2 Mon Sep 17 00:00:00 2001 From: Flowinho Date: Mon, 9 Mar 2020 20:15:04 +0100 Subject: [PATCH] Changing UIContentType from username to email adress Add responder switch to streamline login flow This change achieves two things: - When the user presses Return and the email field is selected, the cursor now switches to the password field (as expected by the user). - It enables iOS to pick up login and password field and enables password autofill. --- iOS/Account/Account.storyboard | 4 ++-- iOS/Account/FeedWranglerAccountViewController.swift | 6 +++++- iOS/Account/FeedbinAccountViewController.swift | 6 +++++- iOS/Settings/Settings.storyboard | 4 ++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/iOS/Account/Account.storyboard b/iOS/Account/Account.storyboard index 9c4011f8f..52982af01 100644 --- a/iOS/Account/Account.storyboard +++ b/iOS/Account/Account.storyboard @@ -1,8 +1,8 @@ - + - + diff --git a/iOS/Account/FeedWranglerAccountViewController.swift b/iOS/Account/FeedWranglerAccountViewController.swift index a5356d09a..eeb2e8551 100644 --- a/iOS/Account/FeedWranglerAccountViewController.swift +++ b/iOS/Account/FeedWranglerAccountViewController.swift @@ -166,7 +166,11 @@ class FeedWranglerAccountViewController: UITableViewController { extension FeedWranglerAccountViewController: UITextFieldDelegate { func textFieldShouldReturn(_ textField: UITextField) -> Bool { - textField.resignFirstResponder() + if textField == emailTextField { + passwordTextField.becomeFirstResponder() + } else { + textField.resignFirstResponder() + } return true } diff --git a/iOS/Account/FeedbinAccountViewController.swift b/iOS/Account/FeedbinAccountViewController.swift index 695ee2a1c..a0d4ea759 100644 --- a/iOS/Account/FeedbinAccountViewController.swift +++ b/iOS/Account/FeedbinAccountViewController.swift @@ -166,7 +166,11 @@ class FeedbinAccountViewController: UITableViewController { extension FeedbinAccountViewController: UITextFieldDelegate { func textFieldShouldReturn(_ textField: UITextField) -> Bool { - textField.resignFirstResponder() + if textField == emailTextField { + passwordTextField.becomeFirstResponder() + } else { + textField.resignFirstResponder() + } return true } diff --git a/iOS/Settings/Settings.storyboard b/iOS/Settings/Settings.storyboard index 97235c536..b3f38b2a5 100644 --- a/iOS/Settings/Settings.storyboard +++ b/iOS/Settings/Settings.storyboard @@ -1,8 +1,8 @@ - + - +