Really appreciating that you're showing ways to code that are so scalable. Really forces you to pay attention to how much you're hitting the server, etc.
I have some experience in Swiftui and I recently made an application for watching movies and linked the project with Firebase, but when I wanted to create a section for series, I found it difficult because I know how to add a single video. How about you explain such a topic and design an application for series?
Hey, It is an Amazing Video. I was following the bootcamp and thought of a use case where I want to show the star on the product on the home screen, If I have added that product to my Favorite list. The solution I could think of is: 1. Create a list in each product with the user ids who have made that product a favorite and then fetch the list with the product and check if the current userId is included or not. 2. Fetch all the favorites in advance and match each product does that include in the user's favorite list. 3. For each product on appear on the screen, Query in the user's favorite list in the user's collection to check if the product id exists in that list. Any Thoughts? Thanks
Can you please show how to send notifications to all users who have a particular item in their list? e.g. if a price changes for a favorite item send them a notification?
Awesome! thank you so much. I've been noticing that sometimes you just use "try" without a do catch block and even without optional "try?" inside a Task and the compiler doesn't complain. Is it because catching errors inside a Task is optional?
I’ve actually never heard of this until googling it right now 😅 I don’t have any videos on it but I’ll include it in a survey at the end to see if there is interest in it. I’ll note that it looks like it would tightly couple Firebase as a dependency to the View, which I would not do in my own apps. The approach I’ve taken in these videos could easily be erased to a protocol for mocking/testing/etc.
@@SwiftfulThinking That's a really good point, so if you were making a production app you'd stick with your current approach in these videos instead of using the property wrapper?
@@tgold94 haha yea, thats why I’m teaching it 🤙 This is exactly what I do in production, except I’ll have a few extra protocols to decouple the dependency completely and inject the manager rather than use a Singleton.
I was having a similar issue… couldn’t find a solution anywhere but after a couple hours came up with this. (My variables/functions are named for my specific project but replace Book with UserFavoriteProduct) func getBooks(orgId: String) async throws -> [Book] { var arr: [Book] = [] do{ let temp = try await orgBooksDBCollection(orgId: orgId).getDocuments() try temp.documents.forEach { x in arr.append( try x.data(as: Book.self)) } } catch{ print(error) } return arr }
Really appreciating that you're showing ways to code that are so scalable. Really forces you to pay attention to how much you're hitting the server, etc.
Thanks again Richard!
You are always my motivation to writing my own app. Very much appreciate your efforts!
I have some experience in Swiftui and I recently made an application for watching movies and linked the project with Firebase, but when I wanted to create a section for series, I found it difficult because I know how to add a single video. How about you explain such a topic and design an application for series?
Hey,
It is an Amazing Video. I was following the bootcamp and thought of a use case where I want to show the star on the product on the home screen,
If I have added that product to my Favorite list.
The solution I could think of is:
1. Create a list in each product with the user ids who have made that product a favorite and then fetch the list with the product and check if the current userId is included or not.
2. Fetch all the favorites in advance and match each product does that include in the user's favorite list.
3. For each product on appear on the screen, Query in the user's favorite list in the user's collection to check if the product id exists in that list.
Any Thoughts?
Thanks
your videos are great.
Thanks JC 🤙
Thank you so much your hard work!
Can you please show how to send notifications to all users who have a particular item in their list? e.g. if a price changes for a favorite item send them a notification?
Awesome! thank you so much. I've been noticing that sometimes you just use "try" without a do catch block and even without optional "try?" inside a Task and the compiler doesn't complain. Is it because catching errors inside a Task is optional?
why mark try with ? you make the fact that it throws an error optional, so your code will continue without giving you an error
UI Question, In 37:12, what makes the images show the loading spinner?
this is called progressView, its a SwfitUI view, you can look it up in his channel.
Hey man loving the series so far, was wondering your thoughts on @FirestoreQuery property wrapper? Will there be any future videos on it?
I’ve actually never heard of this until googling it right now 😅 I don’t have any videos on it but I’ll include it in a survey at the end to see if there is interest in it.
I’ll note that it looks like it would tightly couple Firebase as a dependency to the View, which I would not do in my own apps. The approach I’ve taken in these videos could easily be erased to a protocol for mocking/testing/etc.
@@SwiftfulThinking That's a really good point, so if you were making a production app you'd stick with your current approach in these videos instead of using the property wrapper?
@@tgold94 haha yea, thats why I’m teaching it 🤙 This is exactly what I do in production, except I’ll have a few extra protocols to decouple the dependency completely and inject the manager rather than use a Singleton.
It's a great video ❤
Thanks Khaled!
ok this was a little hard for me, I might have to watch it again sometime..
I think getDocuments as is not working anymore or I'm missing async await somewhere
I was having a similar issue… couldn’t find a solution anywhere but after a couple hours came up with this. (My variables/functions are named for my specific project but replace Book with UserFavoriteProduct)
func getBooks(orgId: String) async throws -> [Book] {
var arr: [Book] = []
do{
let temp = try await orgBooksDBCollection(orgId: orgId).getDocuments()
try temp.documents.forEach { x in
arr.append( try x.data(as: Book.self))
}
} catch{
print(error)
}
return arr
}
Just a warning I have no idea what I’m doing so this is probably not the right way to do it but it worked lol