简体   繁体   中英

Swift UI Firebase AddSnapShotListeners

I am seeing the Firebase call for addSnapshotListener a lot ever since I started learning Swift UI and I don't understand the purpose of using it. I know it is used for observing changes or something along those lines but I don't know exactly what it is or when to use it in Swift UI. Any help, or helpful definitions or examples of when it would be a proper time to use it? Thanks.

Let's say you have a travel list app. Say all your data save in Firestore. When you add new trip you can send to Firestore and Firestore will save and push to you by addSnapshotListener that new added trip then you can insert that trip in your client travel list. Or Chat app. Two client can communicate with addSnapshotListener.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM