diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/UIKitExtensions.swift b/ui/BankingiOSApp/BankingiOSApp/ui/UIKitExtensions.swift index ba5b4846..c8b38a04 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/UIKitExtensions.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/UIKitExtensions.swift @@ -1,6 +1,19 @@ import SwiftUI +extension UIApplication { + + static func hideKeyboard() { + shared.hideKeyboard() + } + + func hideKeyboard() { + sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil) + } + +} + + extension UIResponder { @discardableResult func focus() -> Bool { diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift index bb357c48..29c54420 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift @@ -87,6 +87,7 @@ struct AddAccountDialog: View { func addAccount() { if let bank = bank { isTryingToAddAccount = true + UIApplication.hideKeyboard() presenter.addAccountAsync(bankInfo: bank, customerId: customerId, pin: password) { (response) in self.handleAddAccountResponse(response) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/TransferMoneyDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/TransferMoneyDialog.swift index 3b43d08b..b4f32fb6 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/TransferMoneyDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/TransferMoneyDialog.swift @@ -376,6 +376,7 @@ struct TransferMoneyDialog: View { private func transferMoney() { if let amount = inputValidator.convertAmountString(enteredAmountString: self.amount) { isTransferringMoney = true + UIApplication.hideKeyboard() let data = TransferMoneyData(account: account!, creditorName: remitteeName, creditorIban: remitteeIban, creditorBic: remitteeBic, amount: amount, usage: usage, instantPayment: instantPayment)