Using now onReceive instead of creating a Binding
This commit is contained in:
parent
af1e155106
commit
89d6ea1002
|
@ -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<String>(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 {
|
||||
|
|
Loading…
Reference in New Issue