From 89d6ea10025aadb901700ad4fa1af0de39ec12bc Mon Sep 17 00:00:00 2001 From: dankito Date: Fri, 17 Jul 2020 19:58:40 +0200 Subject: [PATCH] Using now onReceive instead of creating a Binding --- .../BankingiOSApp/ui/views/AddAccountDialog.swift | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift index 71253f50..0ddd1833 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift @@ -1,5 +1,6 @@ import SwiftUI import BankingUiSwift +import Combine struct AddAccountDialog: View { @@ -19,16 +20,12 @@ struct AddAccountDialog: View { var body: some View { - let textValueBinding = Binding(get: { - self.enteredBank - }, set: { - self.enteredBank = $0 - self.findBank() - }) - return Form { Section { - TextField("Bank code", text: textValueBinding) + TextField("Bank code", text: $enteredBank) + .onReceive(Just(enteredBank)) { newValue in + self.findBank() + } } Section {