Ich habe online gesucht, habe aber keine Antwort im Zusammenhang mit meiner Frage gefunden. Hoffe jemand könnte mir dabei helfen. Danke im Voraus! Hier ist eine Firebase observeEvent-Funktion.Wie update UI in Firebase observeEvent Block iOS
ref.child("path").observeSingleEvent(of: .value, with: { (snapshot) in
// here I have a for loop
for (_, dict) snapshot.value as! NSDictionary {
// do something...
//
// here I would like to do some UI updating, like a progress bar, or just as simple as update the text in a label
label.text = "an object fetched."
}
// I used to do some UI update here, and it works, like tableview.reloadData(), but this time I would like the UI updating happen in that for loop
}) { (error) in
print(error.localizedDescription)
}
Könnte mir jemand dabei helfen? Ich habe versucht,
DispatchQueue.main.async {
// UI update here but it doesn't work
}
Hoffnung jemand könnte mir helfen, vielen Dank!
Könnte mir jemand dabei helfen? Vielen Dank. Ich möchte die Fortschrittsbalken-Animation mit der Firebase-Datenbank implementieren. –
Eine funktionierende Lösung gefunden [hier] (http://stackoverflow.com/questions/6835472/uilabel-text-not-being-updated) Überprüfen Sie es. –