From 841ad7dea5d4be275cef34e08f1e6a5d43cae8d7 Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 2 Sep 2020 17:47:42 +0200 Subject: [PATCH] Fixed spelling of focused --- .../ui/LabelledUIKitTextField.swift | 4 ++-- .../BankingiOSApp/ui/UIKitTextField.swift | 18 +++++++++--------- .../ui/views/TransferMoneyDialog.swift | 16 ++++++++-------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/LabelledUIKitTextField.swift b/ui/BankingiOSApp/BankingiOSApp/ui/LabelledUIKitTextField.swift index 58962fb5..b4f8c7d4 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/LabelledUIKitTextField.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/LabelledUIKitTextField.swift @@ -25,7 +25,7 @@ struct LabelledUIKitTextField: View { ) } - var isFocussedChanged: ((Bool) -> Void)? = nil + var isFocusedChanged: ((Bool) -> Void)? = nil var isUserInputEnabled: Bool = true @@ -48,7 +48,7 @@ struct LabelledUIKitTextField: View { UIKitTextField(placeholder, text: $text, keyboardType: keyboardType, autocapitalizationType: autocapitalizationType, isPasswordField: isPasswordField, focusOnStart: focusOnStart, focusNextTextFieldOnReturnKeyPress: focusNextTextFieldOnReturnKeyPress, focusTextField: focusTextFieldBinding, - isFocussedChanged: isFocussedChanged, textAlignment: .right, isUserInputEnabled: isUserInputEnabled, + isFocusedChanged: isFocusedChanged, 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 06a0d024..b7c67d3c 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/UIKitTextField.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/UIKitTextField.swift @@ -18,7 +18,7 @@ struct UIKitTextField: UIViewRepresentable { private var focusNextTextFieldOnReturnKeyPress = false @Binding private var focusTextField: Bool - private var isFocussedChanged: ((Bool) -> Void)? = nil + private var isFocusedChanged: ((Bool) -> Void)? = nil private var textAlignment: NSTextAlignment = .natural private var isUserInputEnabled: Bool = true @@ -30,7 +30,7 @@ struct UIKitTextField: UIViewRepresentable { 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, + isFocusedChanged: ((Bool) -> Void)? = nil, textAlignment: NSTextAlignment = .natural, isUserInputEnabled: Bool = true, actionOnReturnKeyPress: (() -> Bool)? = nil, textChanged: ((String) -> Void)? = nil) { self.placeholder = titleKey @@ -43,7 +43,7 @@ struct UIKitTextField: UIViewRepresentable { self.focusOnStart = focusOnStart self.focusNextTextFieldOnReturnKeyPress = focusNextTextFieldOnReturnKeyPress self._focusTextField = focusTextField - self.isFocussedChanged = isFocussedChanged + self.isFocusedChanged = isFocusedChanged self.textAlignment = textAlignment self.isUserInputEnabled = isUserInputEnabled @@ -91,7 +91,7 @@ struct UIKitTextField: UIViewRepresentable { func makeCoordinator() -> UIKitTextField.Coordinator { - return Coordinator(text: $text, focusNextTextFieldOnReturnKeyPress: focusNextTextFieldOnReturnKeyPress, isFocussedChanged: isFocussedChanged, + return Coordinator(text: $text, focusNextTextFieldOnReturnKeyPress: focusNextTextFieldOnReturnKeyPress, isFocusedChanged: isFocusedChanged, isUserInputEnabled: isUserInputEnabled, actionOnReturnKeyPress: actionOnReturnKeyPress, textChanged: textChanged) } @@ -102,7 +102,7 @@ struct UIKitTextField: UIViewRepresentable { private var focusNextTextFieldOnReturnKeyPress: Bool - private var isFocussedChanged: ((Bool) -> Void)? = nil + private var isFocusedChanged: ((Bool) -> Void)? = nil private var isUserInputEnabled: Bool @@ -111,12 +111,12 @@ struct UIKitTextField: UIViewRepresentable { private var textChanged: ((String) -> Void)? - init(text: Binding, focusNextTextFieldOnReturnKeyPress: Bool, isFocussedChanged: ((Bool) -> Void)? = nil, isUserInputEnabled: Bool, + init(text: Binding, focusNextTextFieldOnReturnKeyPress: Bool, isFocusedChanged: ((Bool) -> Void)? = nil, isUserInputEnabled: Bool, actionOnReturnKeyPress: (() -> Bool)? = nil, textChanged: ((String) -> Void)? = nil) { _text = text self.focusNextTextFieldOnReturnKeyPress = focusNextTextFieldOnReturnKeyPress - self.isFocussedChanged = isFocussedChanged + self.isFocusedChanged = isFocusedChanged self.isUserInputEnabled = isUserInputEnabled self.actionOnReturnKeyPress = actionOnReturnKeyPress @@ -128,7 +128,7 @@ struct UIKitTextField: UIViewRepresentable { func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool { if isUserInputEnabled { if textField.isFirstResponder { - isFocussedChanged?(true) + isFocusedChanged?(true) } } @@ -136,7 +136,7 @@ struct UIKitTextField: UIViewRepresentable { } func textFieldDidEndEditing(_ textField: UITextField, reason: UITextField.DidEndEditingReason) { - isFocussedChanged?(false) + isFocusedChanged?(false) } func textFieldDidChangeSelection(_ textField: UITextField) { diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/TransferMoneyDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/TransferMoneyDialog.swift index 13a20898..bf0a6ab2 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/TransferMoneyDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/TransferMoneyDialog.swift @@ -115,7 +115,7 @@ struct TransferMoneyDialog: View { Section { LabelledUIKitTextField(label: "Remittee Name", text: $remitteeName, focusOnStart: true, focusNextTextFieldOnReturnKeyPress: true, - isFocussedChanged: remitteeNameIsFocussedChanged, actionOnReturnKeyPress: handleReturnKeyPress, textChanged: enteredRemitteeNameChanged) + isFocusedChanged: remitteeNameisFocusedChanged, actionOnReturnKeyPress: handleReturnKeyPress, textChanged: enteredRemitteeNameChanged) .padding(.bottom, 0) remitteeNameValidationResult.map { validationError in @@ -129,8 +129,8 @@ struct TransferMoneyDialog: View { } } - LabelledUIKitTextField(label: "Remittee IBAN", text: $remitteeIban, autocapitalizationType: .allCharacters, focusNextTextFieldOnReturnKeyPress: true, isFocussedChanged: validateRemitteeIbanOnFocusLost, - actionOnReturnKeyPress: handleReturnKeyPress, textChanged: remitteeIbanIsFocussedChanged) + LabelledUIKitTextField(label: "Remittee IBAN", text: $remitteeIban, autocapitalizationType: .allCharacters, focusNextTextFieldOnReturnKeyPress: true, isFocusedChanged: validateRemitteeIbanOnFocusLost, + actionOnReturnKeyPress: handleReturnKeyPress, textChanged: remitteeIbanisFocusedChanged) remitteeIbanValidationResult.map { validationError in ValidationLabel(validationError) @@ -216,8 +216,8 @@ struct TransferMoneyDialog: View { } - private func remitteeNameIsFocussedChanged(_ isFocussed: Bool) { - if isFocussed == false { + private func remitteeNameisFocusedChanged(_ isFocused: Bool) { + if isFocused == false { validateRemitteeNameOnFocusLost() self.showRemitteeAutocompleteList = false @@ -261,14 +261,14 @@ struct TransferMoneyDialog: View { } - private func remitteeIbanIsFocussedChanged(_ enteredIban: String) { + private func remitteeIbanisFocusedChanged(_ enteredIban: String) { validateField($remitteeIban, $remitteeIbanValidationResult, $isValidRemitteeIbanEntered) { inputValidator.validateIbanWhileTyping(ibanToTest: enteredIban) } tryToGetBicFromIban(enteredIban) } - private func validateRemitteeIbanOnFocusLost(_ isFocussed: Bool) { - if isFocussed == false { + private func validateRemitteeIbanOnFocusLost(_ isFocused: Bool) { + if isFocused == false { validateRemitteeIbanOnFocusLost() } }