Hiding keyboard when adding account or transferring money
This commit is contained in:
parent
8a2875dd41
commit
c9ed160043
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue