SwiftUI: Fetching data from Firestore in real-time

  Рет қаралды 30,947

Firebase

Firebase

Күн бұрын

SwiftUI makes it super easy to build great-looking UIs in no time - but how do you connect your UI to Firebase? In this episode, Peter will show you a clean and simple way to fetch data from Firestore in real time and display it in a SwiftUI list view.
Chapters:
0:00 Intro
0:45 Walkthrough of the sample app
1:50 How to set up Firebase
2:08 The data model
3:07 Implementing the view model
9:40 Connecting the view model to the list view
11:00 Demo
12:58 Summary and next steps
Resources:
Follow Peter’s blog → goo.gle/2Y114cK
Build a todo app w/SwiftUI & Firebase playlist → goo.gle/39UUab3
Setting up Firebase for iOS → goo.gle/39xIIBZ
Cloud Firestore Intro → goo.gle/2ycqV6L
SwiftUI and Firebase playlist → goo.gle/3f9Uiav
Subscribe to Firebase → goo.gle/Firebase
#FirebaseSemiLive

Пікірлер: 32
@gangalo68
@gangalo68 4 жыл бұрын
What I like with Peters tutorials is that he do it "for real", not all code in one document and leaving the viewer to sort it out. This is great for me who still trying to grasp MVVM. Thanks!
@xingnanzhou8628
@xingnanzhou8628 4 жыл бұрын
You did a great job! Gave me an clear idea of how to transfer data from firebase to an iPhone! Totally support your contribute, and gives you a thumbs up
@chrisgrayston6407
@chrisgrayston6407 3 жыл бұрын
Please keep making videos, they are super helpful. Thank you!
@daehee7312
@daehee7312 4 жыл бұрын
Thank you for your helpful video!!
@abdullahalnutayfi8103
@abdullahalnutayfi8103 3 жыл бұрын
Easy to understand, thank you
@youngdomsey
@youngdomsey 4 жыл бұрын
Great video, thanks
@mateusneves4168
@mateusneves4168 3 жыл бұрын
Thank you for the tutorial, helped me a lot! I have a question: if I just want to get one document, like the first one store in Firestore, how do I get it? In other words, how to get just the author, nm and pages of the 1st document?
@oztoygar
@oztoygar 3 жыл бұрын
Excellent video! I have a question about linking the list to a DetailView. Referring to the video, how can I show the details of the book that I clicked from the list? Thank you in advance :)
@orl123124
@orl123124 2 жыл бұрын
nice excellent ! please keep making video do u have a video about how to upload some file to firebase ?
@pickemparty
@pickemparty 3 жыл бұрын
Can you show how that works for the Firebase Realtime database as well!?
@itskakers
@itskakers 3 жыл бұрын
Thank you for the video! I followed your code structure with my own documents/data but my Xcode preview crashes when I try to preview my List. Two questions: Is there a limit to how many variables you can store in your [Book] array? & is there a limit to how many variables you can display in your list?
@anzhemeng8833
@anzhemeng8833 3 жыл бұрын
Wonderful job, Sir! I think I have already accomplished this feature, but I want to do more: I am developing an app that features a leaderboard, so the list of data is only shown on one tab. However, every time I switch back to this leaderboard page, the table just fades away. I am not sure what is going on, can I make it stable?
@fbetasoft
@fbetasoft Жыл бұрын
Thanks a lot I implemented very easily. But why there are no these informations in Firebase website? for ex. we wrote viewModel.fetchData() inside onAppear(), but when I read firebase documents I couldn't find this info. Also in firebase there is no SwiftUI code option, but only storyboard and obj-c.
@itskakers
@itskakers 3 жыл бұрын
Thank you for the video! I followed your code structure with my own documents/data but my Xcode preview crashes when I try to preview my List. Any idea on why this happens? My code is virtually identical to yours.
@btechstuff
@btechstuff 2 жыл бұрын
Thank you for a great video. It seems though, that my code while I am setting breakpoints, is bypassing all of the document fetching. It is skipping over the addSnapshotListener and all of that and just going to the end of the function. Any idea what is happening?
@ecptavares
@ecptavares 4 жыл бұрын
hi what if my collection gets bigger and reachs 4.000 records.How would I handle this to avoid slow loading?Any example or tutorial?thank you
@joshkinney5091
@joshkinney5091 3 жыл бұрын
I wish you added an image from firebase storage to this as well. It seems tutorials shy away from adding an image.
@abdullahalnutayfi8103
@abdullahalnutayfi8103 3 жыл бұрын
I have a question: How to fetch single value like username (first name). For instance, when I login, I want to show ( logged in by "\(username)")
@jofresh228
@jofresh228 3 жыл бұрын
How do you fetch an array in swiftui with the firestore datas? Thank you
@jorhoto7064
@jorhoto7064 4 жыл бұрын
Hi, is Firestore already available for Unity? Thanks!!
@lukajackson4861
@lukajackson4861 3 жыл бұрын
I have a question. isn't this an expensive operation though? we are just creating a whole new array for just one change in the document. imagine a real-time chat application. users are sending messages left and right. would this be the correct implementation in such a case?
@mochithemaltese
@mochithemaltese 4 жыл бұрын
Is it normal that the VM gets called for every row of data it loads?
@123gorem
@123gorem 3 жыл бұрын
I get this error massage: cannot call value of non-function type '[String: Any]' in the "implementing the view model" part. Someone who can help me?
@aleksneso634
@aleksneso634 3 жыл бұрын
How I can shuffle the documents?
@pickemparty
@pickemparty 3 жыл бұрын
your solution to using a "dynamic" list of items from Firebase doesnt seem to work well when you have a tab bar and the list of items. Along with the behavior of when someone clicks on an item in the list the user should navigate to a "detailed view" where the tab bar would need to be hidden and when they navigate back the tab bar should reappear and display the list again.... it seems to make the list disappear which makes no sense!?
@hp6545
@hp6545 3 жыл бұрын
Its permanently firing requests.... it doesnt matter if its integrated to a tab bar or single view.
@tuckersnow609
@tuckersnow609 2 жыл бұрын
Having the same issue.
@anandaedla9993
@anandaedla9993 4 жыл бұрын
gcloud firestore export gs://[BUCKET_NAME] how to use command ? how to export joson of cloud firestore
Mapping Firestore documents using Swift Codable
14:28
Firebase
Рет қаралды 21 М.
Вечный ДВИГАТЕЛЬ!⚙️ #shorts
00:27
Гараж 54
Рет қаралды 14 МЛН
تجربة أغرب توصيلة شحن ضد القطع تماما
00:56
صدام العزي
Рет қаралды 36 МЛН
孩子多的烦恼?#火影忍者 #家庭 #佐助
00:31
火影忍者一家
Рет қаралды 49 МЛН
I Can't Believe We Did This...
00:38
Stokes Twins
Рет қаралды 95 МЛН
Building a to-do list app with SwiftUI and Firebase - Pt 1
53:56
Connect Firebase to Xcode: A Step-by-Step Tutorial | Firebase Bootcamp #1
21:07
How to Setup Firestore database for your SwiftUI app (2021)
26:32
CodeWithChris
Рет қаралды 25 М.
Get Started with Firebase Firestore in iOS | Firebase Bootcamp #8
39:06
Swiftful Thinking
Рет қаралды 11 М.
Cloud Firestore Get Data (and other operations) with SwiftUI
41:31
CodeWithChris
Рет қаралды 41 М.
MVVM + Dependency Injection in Swift | Unit Testing | iOS
29:29
Adding data to Firestore from a SwiftUI App
18:06
Firebase
Рет қаралды 12 М.
НЕ ПОКУПАЙ СМАРТФОН, ПОКА НЕ УЗНАЕШЬ ЭТО! Не ошибись с выбором…
15:23
Хотела заскамить на Айфон!😱📱(@gertieinar)
0:21
Взрывная История
Рет қаралды 6 МЛН
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 4,9 МЛН
Первый обзор Galaxy Z Fold 6
12:23
Rozetked
Рет қаралды 401 М.
Mastering Picture Editing: Zoom Tools Tutorial
0:52
Photoo Edit
Рет қаралды 505 М.