J'ai recherché en ligne mais n'ai pas trouvé de réponse liée à ma question. J'espère que quelqu'un pourrait m'aider avec ça. Merci d'avance! Voici une fonction Firebase observeEvent.Comment mettre à jour l'interface utilisateur dans Firebase Observerbloquer le bloc 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)
}
Quelqu'un pourrait-il m'aider? J'ai essayé
DispatchQueue.main.async {
// UI update here but it doesn't work
}
J'espère que quelqu'un pourrait m'aider, merci beaucoup!
Quelqu'un pourrait m'aider avec ça? Merci. Je voudrais implémenter l'animation de la barre de progression avec la base de données Firebase. –
Trouvé une solution de travail [ici] (http://stackoverflow.com/questions/6835472/uilabel-text-not-being-updated) Check it out. –