diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/LabelledUIKitTextField.swift b/ui/BankingiOSApp/BankingiOSApp/ui/LabelledUIKitTextField.swift index 67068ade..58962fb5 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/LabelledUIKitTextField.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/LabelledUIKitTextField.swift @@ -10,6 +10,7 @@ struct LabelledUIKitTextField: View { var placeholder: String = "" var keyboardType: UIKeyboardType = .default + var autocapitalizationType: UITextAutocapitalizationType = .sentences var isPasswordField: Bool = false var focusOnStart = false @@ -44,8 +45,8 @@ struct LabelledUIKitTextField: View { } Spacer() - - UIKitTextField(placeholder, text: $text, keyboardType: keyboardType, isPasswordField: isPasswordField, + + UIKitTextField(placeholder, text: $text, keyboardType: keyboardType, autocapitalizationType: autocapitalizationType, isPasswordField: isPasswordField, focusOnStart: focusOnStart, focusNextTextFieldOnReturnKeyPress: focusNextTextFieldOnReturnKeyPress, focusTextField: focusTextFieldBinding, isFocussedChanged: isFocussedChanged, textAlignment: .right, isUserInputEnabled: isUserInputEnabled, actionOnReturnKeyPress: actionOnReturnKeyPress, textChanged: textChanged) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/UIKitTextField.swift b/ui/BankingiOSApp/BankingiOSApp/ui/UIKitTextField.swift index e59f5fcb..03c3d5ac 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/UIKitTextField.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/UIKitTextField.swift @@ -11,6 +11,7 @@ struct UIKitTextField: UIViewRepresentable { private var placeholder: String private var keyboardType: UIKeyboardType = .default + private var autocapitalizationType: UITextAutocapitalizationType = .sentences private var isPasswordField: Bool = false private var focusOnStart = false @@ -27,8 +28,8 @@ struct UIKitTextField: UIViewRepresentable { private var textChanged: ((String) -> Void)? = nil - init(_ titleKey: String, text: Binding, keyboardType: UIKeyboardType = .default, isPasswordField: Bool = false, - focusOnStart: Bool = false, focusNextTextFieldOnReturnKeyPress: Bool = false, focusTextField: Binding = .constant(false), + init(_ titleKey: String, text: Binding, keyboardType: UIKeyboardType = .default, autocapitalizationType: UITextAutocapitalizationType = .sentences, + isPasswordField: Bool = false, focusOnStart: Bool = false, focusNextTextFieldOnReturnKeyPress: Bool = false, focusTextField: Binding = .constant(false), isFocussedChanged: ((Bool) -> Void)? = nil, textAlignment: NSTextAlignment = .natural, isUserInputEnabled: Bool = true, actionOnReturnKeyPress: (() -> Bool)? = nil, textChanged: ((String) -> Void)? = nil) { @@ -36,6 +37,7 @@ struct UIKitTextField: UIViewRepresentable { _text = text self.keyboardType = keyboardType + self.autocapitalizationType = autocapitalizationType self.isPasswordField = isPasswordField self.focusOnStart = focusOnStart @@ -57,6 +59,7 @@ struct UIKitTextField: UIViewRepresentable { textField.placeholder = placeholder.localize() textField.keyboardType = keyboardType + textField.autocapitalizationType = autocapitalizationType textField.isSecureTextEntry = isPasswordField textField.delegate = context.coordinator diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift index 2b37a766..202c8d9a 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift @@ -38,10 +38,10 @@ struct AddAccountDialog: View { Section { LabelledUIKitTextField(label: "Online banking login name", text: $customerId, placeholder: "Enter Online banking login name", - focusNextTextFieldOnReturnKeyPress: true, actionOnReturnKeyPress: handleReturnKeyPress) + autocapitalizationType: .none, focusNextTextFieldOnReturnKeyPress: true, actionOnReturnKeyPress: handleReturnKeyPress) LabelledUIKitTextField(label: "Online banking login password", text: $password, placeholder: "Enter Online banking login password", - isPasswordField: true, actionOnReturnKeyPress: handleReturnKeyPress) + autocapitalizationType: .none, isPasswordField: true, actionOnReturnKeyPress: handleReturnKeyPress) } Section { diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankAccountSettingsDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankAccountSettingsDialog.swift index 9befa7f5..d6b0ebd5 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankAccountSettingsDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankAccountSettingsDialog.swift @@ -31,7 +31,7 @@ struct BankAccountSettingsDialog: View { var body: some View { Form { Section { - LabelledUIKitTextField(label: "Name", text: $displayName) + LabelledUIKitTextField(label: "Name", text: $displayName, autocapitalizationType: .none) } Section { diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankSettingsDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankSettingsDialog.swift index 5950a1a3..2abc6e0d 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankSettingsDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankSettingsDialog.swift @@ -53,9 +53,9 @@ struct BankSettingsDialog: View { } Section(header: Text("Credentials")) { - LabelledUIKitTextField(label: "Online banking login name", text: $customerId) + LabelledUIKitTextField(label: "Online banking login name", text: $customerId, autocapitalizationType: .none) - LabelledUIKitTextField(label: "Online banking login password", text: $password, isPasswordField: true) + LabelledUIKitTextField(label: "Online banking login password", text: $password, autocapitalizationType: .none, isPasswordField: true) } Section { diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/EnterTanDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/EnterTanDialog.swift index c2352081..7e767eb0 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/EnterTanDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/EnterTanDialog.swift @@ -105,7 +105,7 @@ struct EnterTanDialog: View { .padding(.vertical, 2) Section { - LabelledUIKitTextField(label: "Enter TAN:", text: $enteredTan, keyboardType: tanChallenge.tanProcedure.isNumericTan ? .numberPad : .default, actionOnReturnKeyPress: { + LabelledUIKitTextField(label: "Enter TAN:", text: $enteredTan, keyboardType: tanChallenge.tanProcedure.isNumericTan ? .numberPad : .default, autocapitalizationType: .none, actionOnReturnKeyPress: { if self.isRequiredDataEntered() { self.enteringTanDone() return true diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/TransferMoneyDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/TransferMoneyDialog.swift index 62975061..ec8bf799 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/TransferMoneyDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/TransferMoneyDialog.swift @@ -123,7 +123,7 @@ struct TransferMoneyDialog: View { } } - LabelledUIKitTextField(label: "Remittee IBAN", text: $remitteeIban, focusNextTextFieldOnReturnKeyPress: true, isFocussedChanged: validateRemitteeIbanOnFocusLost, + LabelledUIKitTextField(label: "Remittee IBAN", text: $remitteeIban, autocapitalizationType: .allCharacters, focusNextTextFieldOnReturnKeyPress: true, isFocussedChanged: validateRemitteeIbanOnFocusLost, actionOnReturnKeyPress: handleReturnKeyPress, textChanged: validateRemitteeIban) remitteeIbanValidationResult.map { validationError in