From 2e62a23e631d194ecfd9950b22227bcb1cb43479 Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 29 Jul 2020 14:46:22 +0200 Subject: [PATCH] Fixed that text got updated during view update --- ui/BankingiOSApp/BankingiOSApp/ui/UIKitTextField.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/UIKitTextField.swift b/ui/BankingiOSApp/BankingiOSApp/ui/UIKitTextField.swift index 0a07a39c..b9963d88 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/UIKitTextField.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/UIKitTextField.swift @@ -100,7 +100,9 @@ struct UIKitTextField: UIViewRepresentable { } func textFieldDidChangeSelection(_ textField: UITextField) { - text = textField.text ?? "" + DispatchQueue.main.async { // to not update state during view update + self.text = textField.text ?? "" + } } func textFieldShouldReturn(_ textField: UITextField) -> Bool {