Firestore & Swift
Firestore & Swift
Currently I'm working on a project which uses Firestore. The problem I am facing is as follows:
I want to fill a collectionview with data from Firestore, the data is an image + a label. Once a user clicks on the item (image + label) in the collectionview they go to that categorie. So once they click they will get a new collectionview with the items of that categorie (also just an image + label).
Now my question is how do I do this? Cause I can't seem to find related study material for my problem. I have been looking all over Google, YouTube and what not. Most of the tutorials or guides I find are for Firebase Realtime Database (so not Firestore) or are just flat out outdated (pre 2017).
Also I wonder what the best practices are, do I make a struct for my categories and items? Looking for all round tips here or good reading material so I can learn how to do this.
Thanks in advance.
This is would be referred to a Master-Detail type of project. The master contains the collectionView list, then when one it tapped on you display the details in the detail view. Typically you would read your master list of data from Firebase and store them as class objects (or structs) in an array used as the dataSource for the collectionView. When a row is tapped, read that row from the array (so you know which item it was) then read the detail information from Firebase and switch to the detail view. Other than that, it's a very broad question and really not directly answerable.
– Jay
2 days ago
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
This is way too broad a topic for an answer, and asking for links to external tutorials is off-topic on Stack Overflow. That said, you could do worse than start with the Firestore codelab for Swift.
– Frank van Puffelen
2 days ago